]>
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"
23 #include "wx/strconv.h" // wxConvLibc
26 #include "wx/unichar.h"
28 // ===========================================================================
30 // ===========================================================================
33 wxUniChar::value_type
wxUniChar::From8bit(char c
)
35 // all supported charsets have the first 128 characters same as ASCII:
36 if ( (unsigned char)c
< 0x80 )
40 if ( wxConvLibc
.ToWChar(buf
, 2, &c
, 1) != 2 )
41 return wxT('?'); // FIXME-UTF8: what to use as failure character?
46 char wxUniChar::To8bit(wxUniChar::value_type c
)
48 // all supported charsets have the first 128 characters same as ASCII:
54 if ( wxConvLibc
.FromWChar(buf
, 2, &in
, 1) != 2 )
55 return '?'; // FIXME-UTF8: what to use as failure character?