X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f9dbf34fc68514107c9c37e052ada8c6daf81c41..d6c9c1b71e069396bbe3850862de9aa10e6812e0:/src/unix/fontutil.cpp diff --git a/src/unix/fontutil.cpp b/src/unix/fontutil.cpp index 19c96b3df6..224725f7b6 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; @@ -164,6 +171,7 @@ bool wxGetNativeFontEncoding(wxFontEncoding encoding, case wxFONTENCODING_ISO8859_9: case wxFONTENCODING_ISO8859_10: case wxFONTENCODING_ISO8859_11: + case wxFONTENCODING_ISO8859_12: case wxFONTENCODING_ISO8859_13: case wxFONTENCODING_ISO8859_14: case wxFONTENCODING_ISO8859_15: @@ -206,6 +214,8 @@ bool wxGetNativeFontEncoding(wxFontEncoding encoding, return FALSE; } + info->encoding = encoding; + return TRUE; }