]>
git.saurik.com Git - wxWidgets.git/blob - src/common/unichar.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/common/unichar.cpp
3 // Purpose: wxUniChar and wxUniCharRef classes
4 // Author: Vaclav Slavik
7 // Copyright: (c) 2007 REA Elektronik GmbH
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 // ===========================================================================
13 // ===========================================================================
15 // For compilers that support precompilation, includes "wx.h".
16 #include "wx/wxprec.h"
22 #include "wx/unichar.h"
24 // ===========================================================================
26 // ===========================================================================
29 wxUniChar::unicode_type
wxUniChar::From8bit(char c
)
31 // all supported charsets have the first 128 characters same as ASCII:
32 if ( (unsigned char)c
< 0x80 )
36 if ( wxConvLibc
.ToWChar(buf
, 2, &c
, 1) != 2 )
37 return wxT('?'); // FIXME-UTF8: what to use as failure character?
42 char wxUniChar::To8bit(wxUniChar::unicode_type c
)
44 // all supported charsets have the first 128 characters same as ASCII:
50 if ( wxConvLibc
.FromWChar(buf
, 2, &in
, 1) != 2 )
51 return '?'; // FIXME-UTF8: what to use as failure character?