#endif // !wxVsnprintf_
#if !defined(wxSnprintf_)
-int WXDLLEXPORT wxSnprintf_(wxChar *buf, size_t len, const wxChar *format, ...)
+int WXDLLEXPORT wxDoSnprintf_(wxChar *buf, size_t len, const wxChar *format, ...)
{
va_list argptr;
va_start(argptr, format);
#if defined(__DMC__)
/* Digital Mars adds count to _stprintf (C99) so convert */
#if wxUSE_UNICODE
- int wxSprintf (wchar_t * __RESTRICT s, const wchar_t * __RESTRICT format, ... )
+ int wxDoSprintf (wchar_t * __RESTRICT s, const wchar_t * __RESTRICT format, ... )
{
va_list arglist;
#if defined(wxNEED_PRINTF_CONVERSION) || defined(wxNEED_WPRINTF)
-int wxScanf( const wxChar *format, ... )
+int wxDoScanf( const wxChar *format, ... )
{
va_list argptr;
va_start(argptr, format);
return ret;
}
-int wxSscanf( const wxChar *str, const wxChar *format, ... )
+int wxDoSscanf( const wxChar *str, const wxChar *format, ... )
{
va_list argptr;
va_start(argptr, format);
return ret;
}
-int wxFscanf( FILE *stream, const wxChar *format, ... )
+int wxDoFscanf( FILE *stream, const wxChar *format, ... )
{
va_list argptr;
va_start(argptr, format);
return ret;
}
-int wxPrintf( const wxChar *format, ... )
+int wxDoPrintf( const wxChar *format, ... )
{
va_list argptr;
va_start(argptr, format);
}
#ifndef wxSnprintf
-int wxSnprintf( wxChar *str, size_t size, const wxChar *format, ... )
+int wxDoSnprintf( wxChar *str, size_t size, const wxChar *format, ... )
{
va_list argptr;
va_start(argptr, format);
}
#endif // wxSnprintf
-int wxSprintf( wxChar *str, const wxChar *format, ... )
+int wxDoSprintf( wxChar *str, const wxChar *format, ... )
{
va_list argptr;
va_start(argptr, format);
return s.length();
}
-int wxFprintf( FILE *stream, const wxChar *format, ... )
+int wxDoFprintf( FILE *stream, const wxChar *format, ... )
{
va_list argptr;
va_start( argptr, format );
}
#endif
+
+// ----------------------------------------------------------------------------
+// wxUniChar
+// ----------------------------------------------------------------------------
+
+/* static */
+wxUniChar::unicode_type wxUniChar::From8bit(char c)
+{
+ // all supported charsets have the first 128 characters same as ASCII:
+ if ( (unsigned char)c < 0x80 )
+ return c;
+
+ wchar_t buf[2];
+ if ( wxConvLibc.ToWChar(buf, 2, &c, 1) != 2 )
+ return wxT('?'); // FIXME-UTF8: what to use as failure character?
+ return buf[0];
+}
+
+/* static */
+char wxUniChar::To8bit(wxUniChar::unicode_type c)
+{
+ // all supported charsets have the first 128 characters same as ASCII:
+ if ( c < 0x80 )
+ return c;
+
+ wchar_t in = c;
+ char buf[2];
+ if ( wxConvLibc.FromWChar(buf, 2, &in, 1) != 2 )
+ return '?'; // FIXME-UTF8: what to use as failure character?
+ return buf[0];
+}