X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f9dbf34fc68514107c9c37e052ada8c6daf81c41..46cd520d1e12e5d2dbe22b46bb2a8b67b808ce42:/src/unix/fontutil.cpp diff --git a/src/unix/fontutil.cpp b/src/unix/fontutil.cpp index 19c96b3df6..036c84272d 100644 --- a/src/unix/fontutil.cpp +++ b/src/unix/fontutil.cpp @@ -106,10 +106,17 @@ static wxNativeFont wxLoadQueryFont(int pointSize, // ---------------------------------------------------------------------------- // convert to/from the string representation: format is -// registry-encoding[-facename] +// encodingid;registry;encoding[;facename] bool wxNativeEncodingInfo::FromString(const wxString& s) { - wxStringTokenizer tokenizer(s, _T("-")); + wxStringTokenizer tokenizer(s, _T(";")); + // cannot use "-" because it may be part of encoding name + + wxString encid = tokenizer.GetNextToken(); + long enc; + if ( !encid.ToLong(&enc) ) + return FALSE; + encoding = (wxFontEncoding)enc; xregistry = tokenizer.GetNextToken(); if ( !xregistry ) @@ -128,10 +135,10 @@ bool wxNativeEncodingInfo::FromString(const wxString& s) wxString wxNativeEncodingInfo::ToString() const { wxString s; - s << xregistry << _T('-') << xencoding; + s << (long)encoding << _T(';') << xregistry << _T(';') << xencoding; if ( !!facename ) { - s << _T('-') << facename; + s << _T(';') << facename; } return s; @@ -206,6 +213,8 @@ bool wxGetNativeFontEncoding(wxFontEncoding encoding, return FALSE; } + info->encoding = encoding; + return TRUE; }