+#if !wxUSE_UNICODE
+
+wxCharBuffer wxConvertToGTK(const wxString& s, wxFontEncoding enc)
+{
+ if ( enc == wxFONTENCODING_UTF8 )
+ {
+ // no need for conversion at all
+ return wxCharBuffer(s);
+ }
+
+ wxWCharBuffer wbuf;
+ if ( enc == wxFONTENCODING_SYSTEM || enc == wxFONTENCODING_DEFAULT )
+ {
+ wbuf = wxConvUI->cMB2WC(s);
+ }
+ else // another encoding, use generic conversion class
+ {
+ wbuf = wxCSConv(enc).cMB2WC(s);
+ }
+
+ wxCharBuffer buf;
+ if ( wbuf )
+ buf = wxConvUTF8.cWC2MB(wbuf);
+
+ return buf;
+}
+
+#endif // !wxUSE_UNICODE