- if (encodable_.find(c) == encodable_.end()) {
- // c cannot be encoded in this encoding
- CharInfoMap::const_iterator const it = unicodesymbols.find(c);
- if (it == unicodesymbols.end())
- lyxerr << "Could not find LaTeX command for character 0x"
- << std::hex << c << std::dec
- << ".\nLaTeX export will fail."
- << endl;
- else
- return it->second.command;
- }
- return docstring(1, c);
+ if (encodable_.find(c) != encodable_.end())
+ return docstring(1, c);
+
+ // c cannot be encoded in this encoding
+ CharInfoMap::const_iterator const it = unicodesymbols.find(c);
+ if (it == unicodesymbols.end())
+ throw EncodingException(c);
+ return it->second.command;
+}
+
+
+vector<char_type> Encoding::symbolsList() const
+{
+ // assure the used encoding is properly initialized
+ init();
+
+ // first all encodable characters
+ vector<char_type> symbols(encodable_.begin(), encodable_.end());
+ // add those below start_encodable_
+ for (char_type c = 0; c < start_encodable_; ++c)
+ symbols.push_back(c);
+ // now the ones from the unicodesymbols file
+ CharInfoMap::const_iterator const end = unicodesymbols.end();
+ CharInfoMap::const_iterator it = unicodesymbols.begin();
+ for (; it != end; ++it)
+ symbols.push_back(it->first);
+ return symbols;