]>
git.saurik.com Git - wxWidgets.git/blob - src/common/strconv.cpp
8b97f59337961040e0657082aa748dd4f633697b
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Unicode conversion classes
4 // Author: Ove Kaaven, Robert Roebling, Vadim Zeitlin, Vaclav Slavik
8 // Copyright: (c) 1999 Ove Kaaven, Robert Roebling, Vadim Zeitlin, Vaclav Slavik
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
21 #pragma implementation "strconv.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
32 #include "wx/msw/private.h"
53 #include "wx/strconv.h"
58 #define BSWAP_UCS4(str, len) { unsigned _c; for (_c=0; _c<len; _c++) str[_c]=wxUINT32_SWAP_ALWAYS(str[_c]); }
59 #define BSWAP_UTF16(str, len) { unsigned _c; for (_c=0; _c<len; _c++) str[_c]=wxUINT16_SWAP_ALWAYS(str[_c]); }
61 // under Unix SIZEOF_WCHAR_T is defined by configure, but under other platforms
62 // it might be not defined - assume the most common value
63 #ifndef SIZEOF_WCHAR_T
64 #define SIZEOF_WCHAR_T 2
65 #endif // !defined(SIZEOF_WCHAR_T)
67 #if SIZEOF_WCHAR_T == 4
68 #define WC_NAME "UCS4"
69 #define WC_BSWAP BSWAP_UCS4
70 #ifdef WORDS_BIGENDIAN
71 #define WC_NAME_BEST "UCS-4BE"
73 #define WC_NAME_BEST "UCS-4LE"
75 #elif SIZEOF_WCHAR_T == 2
76 #define WC_NAME "UTF16"
77 #define WC_BSWAP BSWAP_UTF16
79 #ifdef WORDS_BIGENDIAN
80 #define WC_NAME_BEST "UTF-16BE"
82 #define WC_NAME_BEST "UTF-16LE"
84 #else // sizeof(wchar_t) != 2 nor 4
85 // I don't know what to do about this
86 #error "Weird sizeof(wchar_t): please report your platform details to wx-users mailing list"
89 // ----------------------------------------------------------------------------
91 // ----------------------------------------------------------------------------
93 WXDLLEXPORT_DATA(wxMBConv
*) wxConvCurrent
= &wxConvLibc
;
95 // ============================================================================
97 // ============================================================================
101 static size_t encode_utf16(wxUint32 input
, wchar_t *output
)
105 if (output
) *output
++ = input
;
108 else if (input
>=0x110000)
116 *output
++ = (input
>> 10)+0xd7c0;
117 *output
++ = (input
&0x3ff)+0xdc00;
123 static size_t decode_utf16(const wchar_t* input
, wxUint32
& output
)
125 if ((*input
<0xd800) || (*input
>0xdfff))
130 else if ((input
[1]<0xdc00) || (input
[1]>=0xdfff))
137 output
= ((input
[0] - 0xd7c0) << 10) + (input
[1] - 0xdc00);
144 // ----------------------------------------------------------------------------
146 // ----------------------------------------------------------------------------
148 WXDLLEXPORT_DATA(wxMBConv
) wxConvLibc
;
150 size_t wxMBConv::MB2WC(wchar_t *buf
, const char *psz
, size_t n
) const
152 return wxMB2WC(buf
, psz
, n
);
155 size_t wxMBConv::WC2MB(char *buf
, const wchar_t *psz
, size_t n
) const
157 return wxWC2MB(buf
, psz
, n
);
160 const wxWCharBuffer
wxMBConv::cMB2WC(const char *psz
) const
164 size_t nLen
= MB2WC((wchar_t *) NULL
, psz
, 0);
165 if (nLen
== (size_t)-1)
166 return wxWCharBuffer((wchar_t *) NULL
);
167 wxWCharBuffer
buf(nLen
);
168 MB2WC((wchar_t *)(const wchar_t *) buf
, psz
, nLen
);
172 return wxWCharBuffer((wchar_t *) NULL
);
175 const wxCharBuffer
wxMBConv::cWC2MB(const wchar_t *psz
) const
179 size_t nLen
= WC2MB((char *) NULL
, psz
, 0);
180 if (nLen
== (size_t)-1)
181 return wxCharBuffer((char *) NULL
);
182 wxCharBuffer
buf(nLen
);
183 WC2MB((char *)(const char *) buf
, psz
, nLen
);
187 return wxCharBuffer((char *) NULL
);
190 // ----------------------------------------------------------------------------
191 // standard file conversion
192 // ----------------------------------------------------------------------------
194 WXDLLEXPORT_DATA(wxMBConvFile
) wxConvFile
;
196 // just use the libc conversion for now
197 size_t wxMBConvFile::MB2WC(wchar_t *buf
, const char *psz
, size_t n
) const
199 return wxMB2WC(buf
, psz
, n
);
202 size_t wxMBConvFile::WC2MB(char *buf
, const wchar_t *psz
, size_t n
) const
204 return wxWC2MB(buf
, psz
, n
);
207 // ----------------------------------------------------------------------------
208 // standard gdk conversion
209 // ----------------------------------------------------------------------------
213 WXDLLEXPORT_DATA(wxMBConvGdk
) wxConvGdk
;
217 size_t wxMBConvGdk::MB2WC(wchar_t *buf
, const char *psz
, size_t n
) const
221 return gdk_mbstowcs((GdkWChar
*)buf
, psz
, n
);
225 GdkWChar
*nbuf
= new GdkWChar
[n
=strlen(psz
)];
226 size_t len
= gdk_mbstowcs(nbuf
, psz
, n
);
232 size_t wxMBConvGdk::WC2MB(char *buf
, const wchar_t *psz
, size_t n
) const
234 char *mbstr
= gdk_wcstombs((GdkWChar
*)psz
);
235 size_t len
= mbstr
? strlen(mbstr
) : 0;
240 memcpy(buf
, psz
, len
);
249 // ----------------------------------------------------------------------------
251 // ----------------------------------------------------------------------------
253 WXDLLEXPORT_DATA(wxMBConvUTF7
) wxConvUTF7
;
256 static char utf7_setD
[]="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
257 "abcdefghijklmnopqrstuvwxyz"
258 "0123456789'(),-./:?";
259 static char utf7_setO
[]="!\"#$%&*;<=>@[]^_`{|}";
260 static char utf7_setB
[]="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
261 "abcdefghijklmnopqrstuvwxyz"
265 // TODO: write actual implementations of UTF-7 here
266 size_t wxMBConvUTF7::MB2WC(wchar_t * WXUNUSED(buf
),
267 const char * WXUNUSED(psz
),
268 size_t WXUNUSED(n
)) const
273 size_t wxMBConvUTF7::WC2MB(char * WXUNUSED(buf
),
274 const wchar_t * WXUNUSED(psz
),
275 size_t WXUNUSED(n
)) const
280 // ----------------------------------------------------------------------------
282 // ----------------------------------------------------------------------------
284 WXDLLEXPORT_DATA(wxMBConvUTF8
) wxConvUTF8
;
286 static wxUint32 utf8_max
[]=
287 { 0x7f, 0x7ff, 0xffff, 0x1fffff, 0x3ffffff, 0x7fffffff, 0xffffffff };
289 size_t wxMBConvUTF8::MB2WC(wchar_t *buf
, const char *psz
, size_t n
) const
293 while (*psz
&& ((!buf
) || (len
< n
)))
295 unsigned char cc
= *psz
++, fc
= cc
;
297 for (cnt
= 0; fc
& 0x80; cnt
++)
311 // invalid UTF-8 sequence
316 unsigned ocnt
= cnt
- 1;
317 wxUint32 res
= cc
& (0x3f >> cnt
);
321 if ((cc
& 0xC0) != 0x80)
323 // invalid UTF-8 sequence
326 res
= (res
<< 6) | (cc
& 0x3f);
328 if (res
<= utf8_max
[ocnt
])
330 // illegal UTF-8 encoding
334 size_t pa
= encode_utf16(res
, buf
);
335 if (pa
== (size_t)-1)
348 if (buf
&& (len
< n
))
353 size_t wxMBConvUTF8::WC2MB(char *buf
, const wchar_t *psz
, size_t n
) const
357 while (*psz
&& ((!buf
) || (len
< n
)))
361 size_t pa
= decode_utf16(psz
, cc
);
362 psz
+= (pa
== (size_t)-1) ? 1 : pa
;
364 cc
=(*psz
++) & 0x7fffffff;
367 for (cnt
= 0; cc
> utf8_max
[cnt
]; cnt
++) {}
381 *buf
++ = (-128 >> cnt
) | ((cc
>> (cnt
* 6)) & (0x3f >> cnt
));
383 *buf
++ = 0x80 | ((cc
>> (cnt
* 6)) & 0x3f);
388 if (buf
&& (len
<n
)) *buf
= 0;
392 // ----------------------------------------------------------------------------
393 // specified character set
394 // ----------------------------------------------------------------------------
396 WXDLLEXPORT_DATA(wxCSConv
) wxConvLocal((const wxChar
*)NULL
);
398 #include "wx/encconv.h"
399 #include "wx/fontmap.h"
401 // TODO: add some tables here
402 // - perhaps common encodings to common codepages (for Win32)
403 // - perhaps common encodings to objects ("UTF8" -> wxConvUTF8)
404 // - move wxEncodingConverter meat in here
406 #if defined(__WIN32__) && !defined(__WXMICROWIN__)
407 #include "wx/msw/registry.h"
408 // this should work if M$ Internet Exploiter is installed
409 static long CharsetToCodepage(const wxChar
*name
)
418 wxString
path(wxT("MIME\\Database\\Charset\\"));
420 wxRegKey
key(wxRegKey::HKCR
, path
);
422 if (!key
.Exists()) break;
424 // two cases: either there's an AliasForCharset string,
425 // or there are Codepage and InternetEncoding dwords.
426 // The InternetEncoding gives us the actual encoding,
427 // the Codepage just says which Windows character set to
428 // use when displaying the data.
429 if (key
.HasValue(wxT("InternetEncoding")) &&
430 key
.QueryValue(wxT("InternetEncoding"), &CP
)) break;
432 // no encoding, see if it's an alias
433 if (!key
.HasValue(wxT("AliasForCharset")) ||
434 !key
.QueryValue(wxT("AliasForCharset"), cn
)) break;
444 wxCharacterSet(const wxChar
*name
)
446 virtual ~wxCharacterSet()
448 virtual size_t MB2WC(wchar_t *buf
, const char *psz
, size_t n
)
449 { return (size_t)-1; }
450 virtual size_t WC2MB(char *buf
, const wchar_t *psz
, size_t n
)
451 { return (size_t)-1; }
452 virtual bool usable()
458 class ID_CharSet
: public wxCharacterSet
461 ID_CharSet(const wxChar
*name
,wxMBConv
*cnv
)
462 : wxCharacterSet(name
), work(cnv
) {}
464 size_t MB2WC(wchar_t *buf
, const char *psz
, size_t n
)
465 { return work
? work
->MB2WC(buf
,psz
,n
) : (size_t)-1; }
467 size_t WC2MB(char *buf
, const wchar_t *psz
, size_t n
)
468 { return work
? work
->WC2MB(buf
,psz
,n
) : (size_t)-1; }
471 { return work
!=NULL
; }
479 bool g_wcNeedsSwap
= FALSE
;
480 static const char *g_wcCharset
= NULL
;
482 // VS: glibc 2.1.3 is broken in that iconv() conversion to/from UCS4 fails with E2BIG
483 // if output buffer is _exactly_ as big as needed. Such case is (unless there's
484 // yet another bug in glibc) the only case when iconv() returns with (size_t)-1
485 // (which means error) and says there are 0 bytes left in the input buffer --
486 // when _real_ error occurs, bytes-left-in-input buffer is non-zero. Hence,
487 // this alternative test for iconv() failure.
488 // [This bug does not appear in glibc 2.2.]
489 #if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ <= 1
490 #define ICONV_FAILED(cres, bufLeft) ((cres == (size_t)-1) && \
491 (errno != E2BIG || bufLeft != 0))
493 #define ICONV_FAILED(cres, bufLeft) (cres == (size_t)-1)
496 class IC_CharSet
: public wxCharacterSet
499 IC_CharSet(const wxChar
*name
)
500 : wxCharacterSet(name
)
502 // check for charset that represents wchar_t:
503 if (g_wcCharset
== NULL
)
505 g_wcNeedsSwap
= FALSE
;
507 // try charset with explicit bytesex info (e.g. "UCS-4LE"):
508 g_wcCharset
= WC_NAME_BEST
;
509 m2w
= iconv_open(g_wcCharset
, wxConvLibc
.cWX2MB(name
));
511 if (m2w
== (iconv_t
)-1)
513 // try charset w/o bytesex info (e.g. "UCS4")
514 // and check for bytesex ourselves:
515 g_wcCharset
= WC_NAME
;
516 m2w
= iconv_open(g_wcCharset
, wxConvLibc
.cWX2MB(name
));
518 // last bet, try if it knows WCHAR_T pseudo-charset
519 if (m2w
== (iconv_t
)-1)
521 g_wcCharset
= "WCHAR_T";
522 m2w
= iconv_open(g_wcCharset
, wxConvLibc
.cWX2MB(name
));
525 if (m2w
!= (iconv_t
)-1)
527 char buf
[2], *bufPtr
;
528 wchar_t wbuf
[2], *wbufPtr
;
536 outsz
= SIZEOF_WCHAR_T
* 2;
540 #ifdef WX_ICONV_TAKES_CHAR
541 res
= iconv(m2w
, (char**)&bufPtr
, &insz
, (char**)&wbufPtr
, &outsz
);
543 res
= iconv(m2w
, (const char**)&bufPtr
, &insz
, (char**)&wbufPtr
, &outsz
);
545 if (ICONV_FAILED(res
, insz
))
548 wxLogLastError(wxT("iconv"));
549 wxLogError(_("Convertion to charset '%s' doesn't work."), name
);
553 g_wcNeedsSwap
= (wbuf
[0] != (wchar_t)buf
[0]);
559 wxLogError(_("Don't know how to convert to/from charset '%s'."), name
);
562 wxLogTrace(wxT("strconv"), wxT("wchar_t charset is '%s', needs swap: %i"), g_wcCharset
, g_wcNeedsSwap
);
565 m2w
= iconv_open(g_wcCharset
, wxConvLibc
.cWX2MB(name
));
567 w2m
= iconv_open(wxConvLibc
.cWX2MB(name
), g_wcCharset
);
572 if ( m2w
!= (iconv_t
)-1 )
574 if ( w2m
!= (iconv_t
)-1 )
578 size_t MB2WC(wchar_t *buf
, const char *psz
, size_t n
)
580 size_t inbuf
= strlen(psz
);
581 size_t outbuf
= n
* SIZEOF_WCHAR_T
;
583 // VS: Use these instead of psz, buf because iconv() modifies its arguments:
584 wchar_t *bufPtr
= buf
;
585 const char *pszPtr
= psz
;
589 // have destination buffer, convert there
590 #ifdef WX_ICONV_TAKES_CHAR
591 cres
= iconv(m2w
, (char**)&pszPtr
, &inbuf
, (char**)&bufPtr
, &outbuf
);
593 cres
= iconv(m2w
, &pszPtr
, &inbuf
, (char**)&bufPtr
, &outbuf
);
595 res
= n
- (outbuf
/ SIZEOF_WCHAR_T
);
599 // convert to native endianness
600 WC_BSWAP(buf
/* _not_ bufPtr */, res
)
605 // no destination buffer... convert using temp buffer
606 // to calculate destination buffer requirement
610 bufPtr
= tbuf
; outbuf
= 8*SIZEOF_WCHAR_T
;
611 #ifdef WX_ICONV_TAKES_CHAR
612 cres
= iconv( m2w
, (char**)&pszPtr
, &inbuf
, (char**)&bufPtr
, &outbuf
);
614 cres
= iconv( m2w
, &pszPtr
, &inbuf
, (char**)&bufPtr
, &outbuf
);
616 res
+= 8-(outbuf
/SIZEOF_WCHAR_T
);
617 } while ((cres
==(size_t)-1) && (errno
==E2BIG
));
620 if (ICONV_FAILED(cres
, inbuf
))
622 //VS: it is ok if iconv fails, hence trace only
623 wxLogTrace(wxT("strconv"), wxT("iconv failed: %s"), wxSysErrorMsg(wxSysErrorCode()));
630 size_t WC2MB(char *buf
, const wchar_t *psz
, size_t n
)
632 #if defined(__BORLANDC__) && (__BORLANDC__ > 0x530)
633 size_t inbuf
= std::wcslen(psz
) * SIZEOF_WCHAR_T
;
635 size_t inbuf
= ::wcslen(psz
) * SIZEOF_WCHAR_T
;
644 // need to copy to temp buffer to switch endianness
645 // this absolutely doesn't rock!
646 // (no, doing WC_BSWAP twice on the original buffer won't help, as it
647 // could be in read-only memory, or be accessed in some other thread)
648 tmpbuf
=(wchar_t*)malloc((inbuf
+1)*SIZEOF_WCHAR_T
);
649 memcpy(tmpbuf
,psz
,(inbuf
+1)*SIZEOF_WCHAR_T
);
650 WC_BSWAP(tmpbuf
, inbuf
)
656 // have destination buffer, convert there
657 #ifdef WX_ICONV_TAKES_CHAR
658 cres
= iconv( w2m
, (char**)&psz
, &inbuf
, &buf
, &outbuf
);
660 cres
= iconv( w2m
, (const char**)&psz
, &inbuf
, &buf
, &outbuf
);
666 // no destination buffer... convert using temp buffer
667 // to calculate destination buffer requirement
671 buf
= tbuf
; outbuf
= 16;
672 #ifdef WX_ICONV_TAKES_CHAR
673 cres
= iconv( w2m
, (char**)&psz
, &inbuf
, &buf
, &outbuf
);
675 cres
= iconv( w2m
, (const char**)&psz
, &inbuf
, &buf
, &outbuf
);
678 } while ((cres
==(size_t)-1) && (errno
==E2BIG
));
686 if (ICONV_FAILED(cres
, inbuf
))
688 //VS: it is ok if iconv fails, hence trace only
689 wxLogTrace(wxT("strconv"), wxT("iconv failed: %s"), wxSysErrorMsg(wxSysErrorCode()));
697 { return (m2w
!= (iconv_t
)-1) && (w2m
!= (iconv_t
)-1); }
704 #if defined(__WIN32__) && !defined(__WXMICROWIN__)
705 class CP_CharSet
: public wxCharacterSet
708 CP_CharSet(const wxChar
*name
)
709 : wxCharacterSet(name
), CodePage(CharsetToCodepage(name
)) {}
711 size_t MB2WC(wchar_t *buf
, const char *psz
, size_t n
)
714 MultiByteToWideChar(CodePage
, 0, psz
, -1, buf
, buf
? n
: 0);
715 //VS: returns # of written chars for buf!=NULL and *size*
716 // needed buffer for buf==NULL
717 return len
? (buf
? len
: len
-1) : (size_t)-1;
720 size_t WC2MB(char *buf
, const wchar_t *psz
, size_t n
)
722 size_t len
= WideCharToMultiByte(CodePage
, 0, psz
, -1, buf
,
723 buf
? n
: 0, NULL
, NULL
);
724 //VS: returns # of written chars for buf!=NULL and *size*
725 // needed buffer for buf==NULL
726 return len
? (buf
? len
: len
-1) : (size_t)-1;
730 { return CodePage
!= -1; }
739 class EC_CharSet
: public wxCharacterSet
742 // temporarily just use wxEncodingConverter stuff,
743 // so that it works while a better implementation is built
744 EC_CharSet(const wxChar
*name
) : wxCharacterSet(name
),
745 enc(wxFONTENCODING_SYSTEM
)
748 enc
= wxTheFontMapper
->CharsetToEncoding(name
, FALSE
);
749 m2w
.Init(enc
, wxFONTENCODING_UNICODE
);
750 w2m
.Init(wxFONTENCODING_UNICODE
, enc
);
753 size_t MB2WC(wchar_t *buf
, const char *psz
, size_t n
)
755 size_t inbuf
= strlen(psz
);
757 m2w
.Convert(psz
,buf
);
761 size_t WC2MB(char *buf
, const wchar_t *psz
, size_t n
)
763 #if defined(__BORLANDC__) && (__BORLANDC__ > 0x530)
764 size_t inbuf
= std::wcslen(psz
);
766 size_t inbuf
= ::wcslen(psz
);
769 w2m
.Convert(psz
,buf
);
775 { return (enc
!=wxFONTENCODING_SYSTEM
) && (enc
!=wxFONTENCODING_DEFAULT
); }
779 wxEncodingConverter m2w
, w2m
;
782 #endif // wxUSE_FONTMAP
784 static wxCharacterSet
*wxGetCharacterSet(const wxChar
*name
)
786 wxCharacterSet
*cset
= NULL
;
789 if (wxStricmp(name
, wxT("UTF8")) == 0 || wxStricmp(name
, wxT("UTF-8")) == 0)
791 cset
= new ID_CharSet(name
, &wxConvUTF8
);
796 cset
= new IC_CharSet(name
); // may not take NULL
801 if (cset
&& cset
->usable())
810 #if defined(__WIN32__) && !defined(__WXMICROWIN__)
811 cset
= new CP_CharSet(name
); // may take NULL
819 cset
= new EC_CharSet(name
);
822 #endif // wxUSE_FONTMAP
825 wxLogError(_("Unknown encoding '%s'!"), name
);
829 wxCSConv::wxCSConv(const wxChar
*charset
)
831 m_name
= (wxChar
*)NULL
;
832 m_cset
= (wxCharacterSet
*) NULL
;
838 wxCSConv::~wxCSConv()
844 void wxCSConv::SetName(const wxChar
*charset
)
848 m_name
= wxStrdup(charset
);
853 void wxCSConv::LoadNow()
859 wxString name
= wxLocale::GetSystemEncodingName();
864 // wxGetCharacterSet() complains about NULL name
865 m_cset
= m_name
? wxGetCharacterSet(m_name
) : NULL
;
870 size_t wxCSConv::MB2WC(wchar_t *buf
, const char *psz
, size_t n
) const
872 ((wxCSConv
*)this)->LoadNow(); // discard constness
875 return m_cset
->MB2WC(buf
, psz
, n
);
878 size_t len
= strlen(psz
);
882 for (size_t c
= 0; c
<= len
; c
++)
883 buf
[c
] = (unsigned char)(psz
[c
]);
889 size_t wxCSConv::WC2MB(char *buf
, const wchar_t *psz
, size_t n
) const
891 ((wxCSConv
*)this)->LoadNow(); // discard constness
894 return m_cset
->WC2MB(buf
, psz
, n
);
897 #if defined(__BORLANDC__) && (__BORLANDC__ > 0x530)
898 size_t len
=std::wcslen(psz
);
900 size_t len
=::wcslen(psz
);
904 for (size_t c
= 0; c
<= len
; c
++)
905 buf
[c
] = (psz
[c
] > 0xff) ? '?' : psz
[c
];
913 class IC_CharSetConverter
916 IC_CharSetConverter(IC_CharSet
*from
, IC_CharSet
*to
)
918 cnv
= iconv_open(wxConvLibc
.cWX2MB(to
->cname
),
919 wxConvLibc
.cWX2MB(from
->cname
));
922 ~IC_CharSetConverter()
924 if (cnv
!= (iconv_t
)-1)
928 size_t Convert(char *buf
, const char *psz
, size_t n
)
930 size_t inbuf
= strlen(psz
);
932 #ifdef WX_ICONV_TAKES_CHAR
933 size_t res
= iconv( cnv
, (char**)&psz
, &inbuf
, &buf
, &outbuf
);
935 size_t res
= iconv( cnv
, &psz
, &inbuf
, &buf
, &outbuf
);
937 if (res
== (size_t)-1)
946 #endif // HAVE_ICONV_H
948 class EC_CharSetConverter
951 EC_CharSetConverter(EC_CharSet
* from
,EC_CharSet
* to
)
952 { cnv
.Init(from
->enc
,to
->enc
); }
954 size_t Convert(char* buf
, const char* psz
, size_t n
)
956 size_t inbuf
= strlen(psz
);
957 if (buf
) cnv
.Convert(psz
,buf
);
962 wxEncodingConverter cnv
;
965 #else // !wxUSE_WCHAR_T
967 // ----------------------------------------------------------------------------
968 // stand-ins in absence of wchar_t
969 // ----------------------------------------------------------------------------
971 WXDLLEXPORT_DATA(wxMBConv
) wxConvLibc
, wxConvFile
;
972 WXDLLEXPORT_DATA(wxMBConv
*) wxConvCurrent
= &wxConvLibc
;
974 #endif // wxUSE_WCHAR_T