making sure unknown charsets are not defaulting to a valid system default
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@55712 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2735,7 +2735,8 @@ public:
|
|||||||
#if wxUSE_FONTMAP
|
#if wxUSE_FONTMAP
|
||||||
wxMBConv_mac(const wxChar* name)
|
wxMBConv_mac(const wxChar* name)
|
||||||
{
|
{
|
||||||
Init( wxMacGetSystemEncFromFontEnc( wxFontMapperBase::Get()->CharsetToEncoding(name, false) ) );
|
wxFontEncoding enc = wxFontMapperBase::Get()->CharsetToEncoding(name, false);
|
||||||
|
Init( (enc != wxFONTENCODING_SYSTEM) ? wxMacGetSystemEncFromFontEnc( enc ) : kTextEncodingUnknown);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -2758,13 +2759,22 @@ public:
|
|||||||
{
|
{
|
||||||
m_MB2WC_converter = NULL ;
|
m_MB2WC_converter = NULL ;
|
||||||
m_WC2MB_converter = NULL ;
|
m_WC2MB_converter = NULL ;
|
||||||
m_char_encoding = CreateTextEncoding(encoding, encodingVariant, encodingFormat) ;
|
if ( encoding != kTextEncodingUnknown )
|
||||||
m_unicode_encoding = CreateTextEncoding(kTextEncodingUnicodeDefault, 0, kUnicode16BitFormat) ;
|
{
|
||||||
|
m_char_encoding = CreateTextEncoding(encoding, encodingVariant, encodingFormat) ;
|
||||||
|
m_unicode_encoding = CreateTextEncoding(kTextEncodingUnicodeDefault, 0, kUnicode16BitFormat) ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_char_encoding = kTextEncodingUnknown;
|
||||||
|
m_unicode_encoding = kTextEncodingUnknown;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void CreateIfNeeded() const
|
virtual void CreateIfNeeded() const
|
||||||
{
|
{
|
||||||
if ( m_MB2WC_converter == NULL && m_WC2MB_converter == NULL )
|
if ( m_MB2WC_converter == NULL && m_WC2MB_converter == NULL &&
|
||||||
|
m_char_encoding != kTextEncodingUnknown && m_unicode_encoding != kTextEncodingUnknown )
|
||||||
{
|
{
|
||||||
OSStatus status = noErr ;
|
OSStatus status = noErr ;
|
||||||
status = TECCreateConverter(&m_MB2WC_converter,
|
status = TECCreateConverter(&m_MB2WC_converter,
|
||||||
|
Reference in New Issue
Block a user