X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6b0eebc537c0f96eab28295b4ae2c4e978a435a5..8290d43d0d43369d007f1c47abf98a45da461a30:/src/mac/fontutil.cpp?ds=sidebyside diff --git a/src/mac/fontutil.cpp b/src/mac/fontutil.cpp index 49d08234bc..c5a0f583d6 100644 --- a/src/mac/fontutil.cpp +++ b/src/mac/fontutil.cpp @@ -48,12 +48,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; @@ -79,7 +85,10 @@ bool wxNativeEncodingInfo::FromString(const wxString& s) wxString wxNativeEncodingInfo::ToString() const { - wxString s(facename); + wxString s; + + s << (long)encoding << _T(';') << facename; + if ( charset != 0 ) { s << _T(';') << charset;