X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetHyperlink.cpp;h=37692af97a634c65244245908861036357a14206;hb=5801ee2f9a0f6536c6753567b191302960b3bf4f;hp=442b839f0e5bb2a73b1e1fabee82c3bb1a4029b2;hpb=7287a259c5436b8f3f384c0d0bd7641a2f2601e9;p=lyx.git diff --git a/src/insets/InsetHyperlink.cpp b/src/insets/InsetHyperlink.cpp index 442b839f0e..37692af97a 100644 --- a/src/insets/InsetHyperlink.cpp +++ b/src/insets/InsetHyperlink.cpp @@ -15,6 +15,7 @@ #include "Buffer.h" #include "DispatchResult.h" +#include "Encoding.h" #include "Format.h" #include "FuncRequest.h" #include "FuncStatus.h" @@ -28,6 +29,8 @@ #include "support/gettext.h" #include "support/lstrings.h" +#include "frontends/alert.h" + using namespace std; using namespace lyx::support; @@ -185,7 +188,17 @@ void InsetHyperlink::latex(otexstream & os, (pos = name.find('~', i)) != string::npos; i = pos + 1) name.replace(pos, 1, sim); - + pair name_latexed = + runparams.encoding->latexString(name, runparams.dryrun); + name = name_latexed.first; + if (!name_latexed.second.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 href inset are not\n" + "representable in the current encoding and therefore have been omitted:\n%1$s."), + name_latexed.second)); + } } // end if (!name.empty()) if (runparams.moving_arg)