X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0e89bb17e8fcac6e970afa137390f688602bbd97..b5a7b0005781f24ab97ed3322530423b6d89fb67:/src/msw/fontutil.cpp diff --git a/src/msw/fontutil.cpp b/src/msw/fontutil.cpp index ecaeb8e2bc..6d80870a22 100644 --- a/src/msw/fontutil.cpp +++ b/src/msw/fontutil.cpp @@ -50,12 +50,18 @@ // ---------------------------------------------------------------------------- // convert to/from the string representation: format is -// facename[;charset] +// encodingid;facename[;charset] bool wxNativeEncodingInfo::FromString(const wxString& s) { wxStringTokenizer tokenizer(s, _T(";")); + wxString encid = tokenizer.GetNextToken(); + long enc; + if ( !encid.ToLong(&enc) ) + return FALSE; + encoding = (wxFontEncoding)enc; + facename = tokenizer.GetNextToken(); if ( !facename ) return FALSE; @@ -81,10 +87,12 @@ bool wxNativeEncodingInfo::FromString(const wxString& s) wxString wxNativeEncodingInfo::ToString() const { - wxString s(facename); + wxString s; + + s << (long)encoding << _T(';') << facename; if ( charset != ANSI_CHARSET ) { - s << _T(';') << charset; + s << _T(';') << charset; } return s; @@ -158,6 +166,8 @@ bool wxGetNativeFontEncoding(wxFontEncoding encoding, return FALSE; } + info->encoding = encoding; + return TRUE; }