]>
git.saurik.com Git - wxWidgets.git/blob - src/common/strconv.cpp
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"
57 #define BSWAP_UCS4(str, len) { unsigned _c; for (_c=0; _c<len; _c++) str[_c]=wxUINT32_SWAP_ALWAYS(str[_c]); }
58 #define BSWAP_UTF16(str, len) { unsigned _c; for (_c=0; _c<len; _c++) str[_c]=wxUINT16_SWAP_ALWAYS(str[_c]); }
60 // under Unix SIZEOF_WCHAR_T is defined by configure, but under other platforms
61 // it might be not defined - assume the most common value
62 #ifndef SIZEOF_WCHAR_T
63 #define SIZEOF_WCHAR_T 2
64 #endif // !defined(SIZEOF_WCHAR_T)
66 #if SIZEOF_WCHAR_T == 4
67 #define WC_NAME "UCS4"
68 #define WC_BSWAP BSWAP_UCS4
69 #ifdef WORDS_BIGENDIAN
70 #define WC_NAME_BEST "UCS-4BE"
72 #define WC_NAME_BEST "UCS-4LE"
74 #elif SIZEOF_WCHAR_T == 2
75 #define WC_NAME "UTF16"
76 #define WC_BSWAP BSWAP_UTF16
78 #ifdef WORDS_BIGENDIAN
79 #define WC_NAME_BEST "UTF-16BE"
81 #define WC_NAME_BEST "UTF-16LE"
83 #else // sizeof(wchar_t) != 2 nor 4
84 // I don't know what to do about this
85 #error "Weird sizeof(wchar_t): please report your platform details to wx-users mailing list"
88 // ----------------------------------------------------------------------------
90 // ----------------------------------------------------------------------------
92 WXDLLEXPORT_DATA(wxMBConv
*) wxConvCurrent
= &wxConvLibc
;
94 // ============================================================================
96 // ============================================================================
102 static size_t encode_utf16(wxUint32 input
, wchar_t *output
)
106 if (output
) *output
++ = input
;
109 else if (input
>=0x110000)
117 *output
++ = (input
>> 10)+0xd7c0;
118 *output
++ = (input
&0x3ff)+0xdc00;
124 static size_t decode_utf16(const wchar_t* input
, wxUint32
& output
)
126 if ((*input
<0xd800) || (*input
>0xdfff))
131 else if ((input
[1]<0xdc00) || (input
[1]>=0xdfff))
138 output
= ((input
[0] - 0xd7c0) << 10) + (input
[1] - 0xdc00);
145 // ----------------------------------------------------------------------------
147 // ----------------------------------------------------------------------------
149 WXDLLEXPORT_DATA(wxMBConv
) wxConvLibc
;
151 size_t wxMBConv::MB2WC(wchar_t *buf
, const char *psz
, size_t n
) const
153 return wxMB2WC(buf
, psz
, n
);
156 size_t wxMBConv::WC2MB(char *buf
, const wchar_t *psz
, size_t n
) const
158 return wxWC2MB(buf
, psz
, n
);
161 const wxWCharBuffer
wxMBConv::cMB2WC(const char *psz
) const
165 size_t nLen
= MB2WC((wchar_t *) NULL
, psz
, 0);
166 if (nLen
== (size_t)-1)
167 return wxWCharBuffer((wchar_t *) NULL
);
168 wxWCharBuffer
buf(nLen
);
169 MB2WC((wchar_t *)(const wchar_t *) buf
, psz
, nLen
);
173 return wxWCharBuffer((wchar_t *) NULL
);
176 const wxCharBuffer
wxMBConv::cWC2MB(const wchar_t *psz
) const
180 size_t nLen
= WC2MB((char *) NULL
, psz
, 0);
181 if (nLen
== (size_t)-1)
182 return wxCharBuffer((char *) NULL
);
183 wxCharBuffer
buf(nLen
);
184 WC2MB((char *)(const char *) buf
, psz
, nLen
);
188 return wxCharBuffer((char *) NULL
);
191 // ----------------------------------------------------------------------------
192 // standard file conversion
193 // ----------------------------------------------------------------------------
195 WXDLLEXPORT_DATA(wxMBConvFile
) wxConvFile
;
197 // just use the libc conversion for now
198 size_t wxMBConvFile::MB2WC(wchar_t *buf
, const char *psz
, size_t n
) const
200 return wxMB2WC(buf
, psz
, n
);
203 size_t wxMBConvFile::WC2MB(char *buf
, const wchar_t *psz
, size_t n
) const
205 return wxWC2MB(buf
, psz
, n
);
208 // ----------------------------------------------------------------------------
209 // standard gdk conversion
210 // ----------------------------------------------------------------------------
214 WXDLLEXPORT_DATA(wxMBConvGdk
) wxConvGdk
;
218 size_t wxMBConvGdk::MB2WC(wchar_t *buf
, const char *psz
, size_t n
) const
222 return gdk_mbstowcs((GdkWChar
*)buf
, psz
, n
);
226 GdkWChar
*nbuf
= new GdkWChar
[n
=strlen(psz
)];
227 size_t len
= gdk_mbstowcs(nbuf
, psz
, n
);
233 size_t wxMBConvGdk::WC2MB(char *buf
, const wchar_t *psz
, size_t n
) const
235 char *mbstr
= gdk_wcstombs((GdkWChar
*)psz
);
236 size_t len
= mbstr
? strlen(mbstr
) : 0;
241 memcpy(buf
, psz
, len
);
250 // ----------------------------------------------------------------------------
252 // ----------------------------------------------------------------------------
254 WXDLLEXPORT_DATA(wxMBConvUTF7
) wxConvUTF7
;
257 static char utf7_setD
[]="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
258 "abcdefghijklmnopqrstuvwxyz"
259 "0123456789'(),-./:?";
260 static char utf7_setO
[]="!\"#$%&*;<=>@[]^_`{|}";
261 static char utf7_setB
[]="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
262 "abcdefghijklmnopqrstuvwxyz"
266 // TODO: write actual implementations of UTF-7 here
267 size_t wxMBConvUTF7::MB2WC(wchar_t * WXUNUSED(buf
),
268 const char * WXUNUSED(psz
),
269 size_t WXUNUSED(n
)) const
274 size_t wxMBConvUTF7::WC2MB(char * WXUNUSED(buf
),
275 const wchar_t * WXUNUSED(psz
),
276 size_t WXUNUSED(n
)) const
281 // ----------------------------------------------------------------------------
283 // ----------------------------------------------------------------------------
285 WXDLLEXPORT_DATA(wxMBConvUTF8
) wxConvUTF8
;
287 static wxUint32 utf8_max
[]=
288 { 0x7f, 0x7ff, 0xffff, 0x1fffff, 0x3ffffff, 0x7fffffff, 0xffffffff };
290 size_t wxMBConvUTF8::MB2WC(wchar_t *buf
, const char *psz
, size_t n
) const
294 while (*psz
&& ((!buf
) || (len
< n
)))
296 unsigned char cc
= *psz
++, fc
= cc
;
298 for (cnt
= 0; fc
& 0x80; cnt
++)
312 // invalid UTF-8 sequence
317 unsigned ocnt
= cnt
- 1;
318 wxUint32 res
= cc
& (0x3f >> cnt
);
322 if ((cc
& 0xC0) != 0x80)
324 // invalid UTF-8 sequence
327 res
= (res
<< 6) | (cc
& 0x3f);
329 if (res
<= utf8_max
[ocnt
])
331 // illegal UTF-8 encoding
335 size_t pa
= encode_utf16(res
, buf
);
336 if (pa
== (size_t)-1)
349 if (buf
&& (len
< n
))
354 size_t wxMBConvUTF8::WC2MB(char *buf
, const wchar_t *psz
, size_t n
) const
358 while (*psz
&& ((!buf
) || (len
< n
)))
362 size_t pa
= decode_utf16(psz
, cc
);
363 psz
+= (pa
== (size_t)-1) ? 1 : pa
;
365 cc
=(*psz
++) & 0x7fffffff;
368 for (cnt
= 0; cc
> utf8_max
[cnt
]; cnt
++) {}
382 *buf
++ = (-128 >> cnt
) | ((cc
>> (cnt
* 6)) & (0x3f >> cnt
));
384 *buf
++ = 0x80 | ((cc
>> (cnt
* 6)) & 0x3f);
389 if (buf
&& (len
<n
)) *buf
= 0;
393 // ----------------------------------------------------------------------------
394 // specified character set
395 // ----------------------------------------------------------------------------
397 WXDLLEXPORT_DATA(wxCSConv
) wxConvLocal((const wxChar
*)NULL
);
399 #include "wx/encconv.h"
400 #include "wx/fontmap.h"
402 // TODO: add some tables here
403 // - perhaps common encodings to common codepages (for Win32)
404 // - perhaps common encodings to objects ("UTF8" -> wxConvUTF8)
405 // - move wxEncodingConverter meat in here
407 #if defined(__WIN32__) && !defined(__WXMICROWIN__)
408 #include "wx/msw/registry.h"
409 // this should work if M$ Internet Exploiter is installed
410 static long CharsetToCodepage(const wxChar
*name
)
419 wxString
path(wxT("MIME\\Database\\Charset\\"));
421 wxRegKey
key(wxRegKey::HKCR
, path
);
423 if (!key
.Exists()) break;
425 // two cases: either there's an AliasForCharset string,
426 // or there are Codepage and InternetEncoding dwords.
427 // The InternetEncoding gives us the actual encoding,
428 // the Codepage just says which Windows character set to
429 // use when displaying the data.
430 if (key
.HasValue(wxT("InternetEncoding")) &&
431 key
.QueryValue(wxT("InternetEncoding"), &CP
)) break;
433 // no encoding, see if it's an alias
434 if (!key
.HasValue(wxT("AliasForCharset")) ||
435 !key
.QueryValue(wxT("AliasForCharset"), cn
)) break;
445 wxCharacterSet(const wxChar
*name
)
447 virtual ~wxCharacterSet()
449 virtual size_t MB2WC(wchar_t *buf
, const char *psz
, size_t n
)
450 { return (size_t)-1; }
451 virtual size_t WC2MB(char *buf
, const wchar_t *psz
, size_t n
)
452 { return (size_t)-1; }
453 virtual bool usable()
459 class ID_CharSet
: public wxCharacterSet
462 ID_CharSet(const wxChar
*name
,wxMBConv
*cnv
)
463 : wxCharacterSet(name
), work(cnv
) {}
465 size_t MB2WC(wchar_t *buf
, const char *psz
, size_t n
)
466 { return work
? work
->MB2WC(buf
,psz
,n
) : (size_t)-1; }
468 size_t WC2MB(char *buf
, const wchar_t *psz
, size_t n
)
469 { return work
? work
->WC2MB(buf
,psz
,n
) : (size_t)-1; }
472 { return work
!=NULL
; }
480 bool g_wcNeedsSwap
= FALSE
;
481 static const char *g_wcCharset
= NULL
;
483 // VS: glibc 2.1.3 is broken in that iconv() conversion to/from UCS4 fails with E2BIG
484 // if output buffer is _exactly_ as big as needed. Such case is (unless there's
485 // yet another bug in glibc) the only case when iconv() returns with (size_t)-1
486 // (which means error) and says there are 0 bytes left in the input buffer --
487 // when _real_ error occurs, bytes-left-in-input buffer is non-zero. Hence,
488 // this alternative test for iconv() failure.
489 // [This bug does not appear in glibc 2.2.]
490 #if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ <= 1
491 #define ICONV_FAILED(cres, bufLeft) ((cres == (size_t)-1) && \
492 (errno != E2BIG || bufLeft != 0))
494 #define ICONV_FAILED(cres, bufLeft) (cres == (size_t)-1)
497 class IC_CharSet
: public wxCharacterSet
500 IC_CharSet(const wxChar
*name
)
501 : wxCharacterSet(name
)
503 // check for charset that represents wchar_t:
504 if (g_wcCharset
== NULL
)
506 g_wcNeedsSwap
= FALSE
;
508 // try charset with explicit bytesex info (e.g. "UCS-4LE"):
509 g_wcCharset
= WC_NAME_BEST
;
510 m2w
= iconv_open(g_wcCharset
, wxConvLibc
.cWX2MB(name
));
512 if (m2w
== (iconv_t
)-1)
514 // try charset w/o bytesex info (e.g. "UCS4")
515 // and check for bytesex ourselves:
516 g_wcCharset
= WC_NAME
;
517 m2w
= iconv_open(g_wcCharset
, wxConvLibc
.cWX2MB(name
));
519 // last bet, try if it knows WCHAR_T pseudo-charset
520 if (m2w
== (iconv_t
)-1)
522 g_wcCharset
= "WCHAR_T";
523 m2w
= iconv_open(g_wcCharset
, wxConvLibc
.cWX2MB(name
));
526 if (m2w
!= (iconv_t
)-1)
528 char buf
[2], *bufPtr
;
529 wchar_t wbuf
[2], *wbufPtr
;
537 outsz
= SIZEOF_WCHAR_T
* 2;
541 #ifdef WX_ICONV_TAKES_CHAR
542 res
= iconv(m2w
, (char**)&bufPtr
, &insz
, (char**)&wbufPtr
, &outsz
);
544 res
= iconv(m2w
, (const char**)&bufPtr
, &insz
, (char**)&wbufPtr
, &outsz
);
546 if (ICONV_FAILED(res
, insz
))
549 wxLogLastError(wxT("iconv"));
550 wxLogError(_("Convertion to charset '%s' doesn't work."), name
);
554 g_wcNeedsSwap
= (wbuf
[0] != (wchar_t)buf
[0]);
560 wxLogError(_("Don't know how to convert to/from charset '%s'."), name
);
563 wxLogTrace(wxT("strconv"), wxT("wchar_t charset is '%s', needs swap: %i"), g_wcCharset
, g_wcNeedsSwap
);
566 m2w
= iconv_open(g_wcCharset
, wxConvLibc
.cWX2MB(name
));
568 w2m
= iconv_open(wxConvLibc
.cWX2MB(name
), g_wcCharset
);
573 if ( m2w
!= (iconv_t
)-1 )
575 if ( w2m
!= (iconv_t
)-1 )
579 size_t MB2WC(wchar_t *buf
, const char *psz
, size_t n
)
581 size_t inbuf
= strlen(psz
);
582 size_t outbuf
= n
* SIZEOF_WCHAR_T
;
584 // VS: Use these instead of psz, buf because iconv() modifies its arguments:
585 wchar_t *bufPtr
= buf
;
586 const char *pszPtr
= psz
;
590 // have destination buffer, convert there
591 #ifdef WX_ICONV_TAKES_CHAR
592 cres
= iconv(m2w
, (char**)&pszPtr
, &inbuf
, (char**)&bufPtr
, &outbuf
);
594 cres
= iconv(m2w
, &pszPtr
, &inbuf
, (char**)&bufPtr
, &outbuf
);
596 res
= n
- (outbuf
/ SIZEOF_WCHAR_T
);
600 // convert to native endianness
601 WC_BSWAP(buf
/* _not_ bufPtr */, res
)
606 // no destination buffer... convert using temp buffer
607 // to calculate destination buffer requirement
611 bufPtr
= tbuf
; outbuf
= 8*SIZEOF_WCHAR_T
;
612 #ifdef WX_ICONV_TAKES_CHAR
613 cres
= iconv( m2w
, (char**)&pszPtr
, &inbuf
, (char**)&bufPtr
, &outbuf
);
615 cres
= iconv( m2w
, &pszPtr
, &inbuf
, (char**)&bufPtr
, &outbuf
);
617 res
+= 8-(outbuf
/SIZEOF_WCHAR_T
);
618 } while ((cres
==(size_t)-1) && (errno
==E2BIG
));
621 if (ICONV_FAILED(cres
, inbuf
))
623 //VS: it is ok if iconv fails, hence trace only
624 wxLogTrace(wxT("strconv"), wxT("iconv failed: %s"), wxSysErrorMsg(wxSysErrorCode()));
631 size_t WC2MB(char *buf
, const wchar_t *psz
, size_t n
)
633 #if defined(__BORLANDC__) && (__BORLANDC__ > 0x530)
634 size_t inbuf
= std::wcslen(psz
) * SIZEOF_WCHAR_T
;
636 size_t inbuf
= ::wcslen(psz
) * SIZEOF_WCHAR_T
;
645 // need to copy to temp buffer to switch endianness
646 // this absolutely doesn't rock!
647 // (no, doing WC_BSWAP twice on the original buffer won't help, as it
648 // could be in read-only memory, or be accessed in some other thread)
649 tmpbuf
=(wchar_t*)malloc((inbuf
+1)*SIZEOF_WCHAR_T
);
650 memcpy(tmpbuf
,psz
,(inbuf
+1)*SIZEOF_WCHAR_T
);
651 WC_BSWAP(tmpbuf
, inbuf
)
657 // have destination buffer, convert there
658 #ifdef WX_ICONV_TAKES_CHAR
659 cres
= iconv( w2m
, (char**)&psz
, &inbuf
, &buf
, &outbuf
);
661 cres
= iconv( w2m
, (const char**)&psz
, &inbuf
, &buf
, &outbuf
);
667 // no destination buffer... convert using temp buffer
668 // to calculate destination buffer requirement
672 buf
= tbuf
; outbuf
= 16;
673 #ifdef WX_ICONV_TAKES_CHAR
674 cres
= iconv( w2m
, (char**)&psz
, &inbuf
, &buf
, &outbuf
);
676 cres
= iconv( w2m
, (const char**)&psz
, &inbuf
, &buf
, &outbuf
);
679 } while ((cres
==(size_t)-1) && (errno
==E2BIG
));
687 if (ICONV_FAILED(cres
, inbuf
))
689 //VS: it is ok if iconv fails, hence trace only
690 wxLogTrace(wxT("strconv"), wxT("iconv failed: %s"), wxSysErrorMsg(wxSysErrorCode()));
698 { return (m2w
!= (iconv_t
)-1) && (w2m
!= (iconv_t
)-1); }
705 #if defined(__WIN32__) && !defined(__WXMICROWIN__)
706 class CP_CharSet
: public wxCharacterSet
709 CP_CharSet(const wxChar
*name
)
710 : wxCharacterSet(name
), CodePage(CharsetToCodepage(name
)) {}
712 size_t MB2WC(wchar_t *buf
, const char *psz
, size_t n
)
715 MultiByteToWideChar(CodePage
, 0, psz
, -1, buf
, buf
? n
: 0);
716 //VS: returns # of written chars for buf!=NULL and *size*
717 // needed buffer for buf==NULL
718 return len
? (buf
? len
: len
-1) : (size_t)-1;
721 size_t WC2MB(char *buf
, const wchar_t *psz
, size_t n
)
723 size_t len
= WideCharToMultiByte(CodePage
, 0, psz
, -1, buf
,
724 buf
? n
: 0, NULL
, NULL
);
725 //VS: returns # of written chars for buf!=NULL and *size*
726 // needed buffer for buf==NULL
727 return len
? (buf
? len
: len
-1) : (size_t)-1;
731 { return CodePage
!= -1; }
740 class EC_CharSet
: public wxCharacterSet
743 // temporarily just use wxEncodingConverter stuff,
744 // so that it works while a better implementation is built
745 EC_CharSet(const wxChar
*name
) : wxCharacterSet(name
),
746 enc(wxFONTENCODING_SYSTEM
)
749 enc
= wxTheFontMapper
->CharsetToEncoding(name
, FALSE
);
750 m2w
.Init(enc
, wxFONTENCODING_UNICODE
);
751 w2m
.Init(wxFONTENCODING_UNICODE
, enc
);
754 size_t MB2WC(wchar_t *buf
, const char *psz
, size_t n
)
756 size_t inbuf
= strlen(psz
);
758 m2w
.Convert(psz
,buf
);
762 size_t WC2MB(char *buf
, const wchar_t *psz
, size_t n
)
764 #if defined(__BORLANDC__) && (__BORLANDC__ > 0x530)
765 size_t inbuf
= std::wcslen(psz
);
767 size_t inbuf
= ::wcslen(psz
);
770 w2m
.Convert(psz
,buf
);
776 { return (enc
!=wxFONTENCODING_SYSTEM
) && (enc
!=wxFONTENCODING_DEFAULT
); }
780 wxEncodingConverter m2w
, w2m
;
783 #endif // wxUSE_FONTMAP
785 static wxCharacterSet
*wxGetCharacterSet(const wxChar
*name
)
787 wxCharacterSet
*cset
= NULL
;
790 if (wxStricmp(name
, wxT("UTF8")) == 0 || wxStricmp(name
, wxT("UTF-8")) == 0)
792 cset
= new ID_CharSet(name
, &wxConvUTF8
);
797 cset
= new IC_CharSet(name
); // may not take NULL
802 if (cset
&& cset
->usable())
811 #if defined(__WIN32__) && !defined(__WXMICROWIN__)
812 cset
= new CP_CharSet(name
); // may take NULL
820 cset
= new EC_CharSet(name
);
823 #endif // wxUSE_FONTMAP
826 wxLogError(_("Unknown encoding '%s'!"), name
);
830 wxCSConv::wxCSConv(const wxChar
*charset
)
832 m_name
= (wxChar
*)NULL
;
833 m_cset
= (wxCharacterSet
*) NULL
;
839 wxCSConv::~wxCSConv()
845 void wxCSConv::SetName(const wxChar
*charset
)
849 m_name
= wxStrdup(charset
);
854 void wxCSConv::LoadNow()
860 wxString name
= wxLocale::GetSystemEncodingName();
865 // wxGetCharacterSet() complains about NULL name
866 m_cset
= m_name
? wxGetCharacterSet(m_name
) : NULL
;
871 size_t wxCSConv::MB2WC(wchar_t *buf
, const char *psz
, size_t n
) const
873 ((wxCSConv
*)this)->LoadNow(); // discard constness
876 return m_cset
->MB2WC(buf
, psz
, n
);
879 size_t len
= strlen(psz
);
883 for (size_t c
= 0; c
<= len
; c
++)
884 buf
[c
] = (unsigned char)(psz
[c
]);
890 size_t wxCSConv::WC2MB(char *buf
, const wchar_t *psz
, size_t n
) const
892 ((wxCSConv
*)this)->LoadNow(); // discard constness
895 return m_cset
->WC2MB(buf
, psz
, n
);
898 #if defined(__BORLANDC__) && (__BORLANDC__ > 0x530)
899 size_t len
=std::wcslen(psz
);
901 size_t len
=::wcslen(psz
);
905 for (size_t c
= 0; c
<= len
; c
++)
906 buf
[c
] = (psz
[c
] > 0xff) ? '?' : psz
[c
];
914 class IC_CharSetConverter
917 IC_CharSetConverter(IC_CharSet
*from
, IC_CharSet
*to
)
919 cnv
= iconv_open(wxConvLibc
.cWX2MB(to
->cname
),
920 wxConvLibc
.cWX2MB(from
->cname
));
923 ~IC_CharSetConverter()
925 if (cnv
!= (iconv_t
)-1)
929 size_t Convert(char *buf
, const char *psz
, size_t n
)
931 size_t inbuf
= strlen(psz
);
933 #ifdef WX_ICONV_TAKES_CHAR
934 size_t res
= iconv( cnv
, (char**)&psz
, &inbuf
, &buf
, &outbuf
);
936 size_t res
= iconv( cnv
, &psz
, &inbuf
, &buf
, &outbuf
);
938 if (res
== (size_t)-1)
947 #endif // HAVE_ICONV_H
949 class EC_CharSetConverter
952 EC_CharSetConverter(EC_CharSet
* from
,EC_CharSet
* to
)
953 { cnv
.Init(from
->enc
,to
->enc
); }
955 size_t Convert(char* buf
, const char* psz
, size_t n
)
957 size_t inbuf
= strlen(psz
);
958 if (buf
) cnv
.Convert(psz
,buf
);
963 wxEncodingConverter cnv
;
966 #else // !wxUSE_WCHAR_T
968 // ----------------------------------------------------------------------------
969 // stand-ins in absence of wchar_t
970 // ----------------------------------------------------------------------------
972 WXDLLEXPORT_DATA(wxMBConv
) wxConvLibc
, wxConvFile
;
974 #endif // wxUSE_WCHAR_T