mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
* docstring.C: add a FIXME in utf8_to_ucs4() WRT static IconvProcessor and Mac
* lyx_main.C: - LyX::prepareExit(): avoid utf8_to_ucs4() conversion at this late stage because this can cause problem on Mac. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15955 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
146631a5c7
commit
4f5432f427
@ -387,9 +387,11 @@ void LyX::prepareExit()
|
||||
lyxerr[Debug::INFO] << "Deleting tmp dir " << package().temp_dir() << endl;
|
||||
|
||||
if (!destroyDir(package().temp_dir())) {
|
||||
docstring const msg =
|
||||
bformat(_("Unable to remove the temporary directory %1$s"),
|
||||
from_utf8(package().temp_dir()));
|
||||
// FIXME UNICODE: package().temp_dir() could in theory contain utf8 characters.
|
||||
// We cannot use from_utf8() here because this involves the use of static data
|
||||
// that may have been destroyed already on Mac systems.
|
||||
docstring const msg = _("Unable to remove the temporary directory") + " "
|
||||
+ package().temp_dir().c_str();
|
||||
Alert::warning(_("Unable to remove temporary directory"), msg);
|
||||
}
|
||||
}
|
||||
|
@ -57,6 +57,12 @@ std::string const to_ascii(docstring const & ucs4)
|
||||
|
||||
void utf8_to_ucs4(std::string const & utf8, docstring & ucs4)
|
||||
{
|
||||
// FIXME (Abdel 17/11/06): static data are evil!
|
||||
// This function cannot be used in the final exit process on Mac because
|
||||
// static data are already destroyed at this stage.
|
||||
// One solution would be to instantiate the utf8 to ucs4 IconvProcessor as a
|
||||
// singleton inside the LyX main class to ensure that it does not get
|
||||
// destroyed too early.
|
||||
static IconvProcessor iconv(ucs4_codeset, "UTF-8");
|
||||
|
||||
size_t n = utf8.size();
|
||||
|
Loading…
Reference in New Issue
Block a user