added tracing code to wide char codeset detection
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35715 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1349,6 +1349,8 @@ wxMBConv_iconv::wxMBConv_iconv(const wxChar *name)
|
|||||||
// check for charset that represents wchar_t:
|
// check for charset that represents wchar_t:
|
||||||
if ( ms_wcCharsetName.empty() )
|
if ( ms_wcCharsetName.empty() )
|
||||||
{
|
{
|
||||||
|
wxLogTrace(TRACE_STRCONV, _T("Looking for wide char codeset:"));
|
||||||
|
|
||||||
#if wxUSE_FONTMAP
|
#if wxUSE_FONTMAP
|
||||||
const wxChar **names = wxFontMapperBase::GetAllEncodingNames(WC_ENC);
|
const wxChar **names = wxFontMapperBase::GetAllEncodingNames(WC_ENC);
|
||||||
#else // !wxUSE_FONTMAP
|
#else // !wxUSE_FONTMAP
|
||||||
@@ -1375,10 +1377,15 @@ wxMBConv_iconv::wxMBConv_iconv(const wxChar *name)
|
|||||||
nameXE += _T("LE");
|
nameXE += _T("LE");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
wxLogTrace(TRACE_STRCONV, _T(" trying charset \"%s\""),
|
||||||
|
nameXE.c_str());
|
||||||
|
|
||||||
m2w = iconv_open(nameXE.ToAscii(), cname);
|
m2w = iconv_open(nameXE.ToAscii(), cname);
|
||||||
if ( m2w == ICONV_T_INVALID )
|
if ( m2w == ICONV_T_INVALID )
|
||||||
{
|
{
|
||||||
// try charset w/o bytesex info (e.g. "UCS4")
|
// try charset w/o bytesex info (e.g. "UCS4")
|
||||||
|
wxLogTrace(TRACE_STRCONV, _T(" trying charset \"%s\""),
|
||||||
|
nameCS.c_str());
|
||||||
m2w = iconv_open(nameCS.ToAscii(), cname);
|
m2w = iconv_open(nameCS.ToAscii(), cname);
|
||||||
|
|
||||||
// and check for bytesex ourselves:
|
// and check for bytesex ourselves:
|
||||||
@@ -1584,7 +1591,6 @@ size_t wxMBConv_iconv::WC2MB(char *buf, const wchar_t *psz, size_t n) const
|
|||||||
|
|
||||||
if (ICONV_FAILED(cres, inbuf))
|
if (ICONV_FAILED(cres, inbuf))
|
||||||
{
|
{
|
||||||
//VS: it is ok if iconv fails, hence trace only
|
|
||||||
wxLogTrace(TRACE_STRCONV, wxT("iconv failed: %s"), wxSysErrorMsg(wxSysErrorCode()));
|
wxLogTrace(TRACE_STRCONV, wxT("iconv failed: %s"), wxSysErrorMsg(wxSysErrorCode()));
|
||||||
return (size_t)-1;
|
return (size_t)-1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user