+
+docstring InsetCommandParams::prepareCommand(OutputParams const & runparams,
+ docstring const & command,
+ ParamInfo::ParamHandling handling) const
+{
+ docstring result;
+ if (handling == ParamInfo::HANDLING_LATEXIFY) {
+ docstring uncodable;
+ for (size_t n = 0; n < command.size(); ++n) {
+ try {
+ result += runparams.encoding->latexChar(command[n]);
+ } catch (EncodingException & /* e */) {
+ LYXERR0("Uncodable character in command inset!");
+ if (runparams.dryrun) {
+ result += "<" + _("LyX Warning: ")
+ + _("uncodable character") + " '";
+ result += docstring(1, command[n]);
+ result += "'>";
+ } else
+ uncodable += command[n];
+ }
+ }
+ if (!uncodable.empty()) {
+ // issue a warning about omitted characters
+ // FIXME: should be passed to the error dialog
+ frontend::Alert::warning(_("Uncodable characters"),
+ bformat(_("The following characters that are used in the inset %1$s are not\n"
+ "representable in the current encoding and therefore have been omitted:\n%2$s."),
+ from_utf8(insetType()), uncodable));
+ }
+ } else if (handling == ParamInfo::HANDLING_ESCAPE)
+ result = escape(command);
+ else
+ result = command;
+
+ return result;
+}
+
+
+docstring InsetCommandParams::getCommand(OutputParams const & runparams) const