Update of /cvsroot/mahogany/M/include
In directory usw-pr-cvs1:/tmp/cvs-serv15314

Modified Files:
        MessageView.h 
Log Message:
checking in somehow not checked in file

Index: MessageView.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/MessageView.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -b -u -2 -r1.26 -r1.27
--- MessageView.h       13 Mar 2002 22:30:03 -0000      1.26
+++ MessageView.h       16 Apr 2002 12:15:08 -0000      1.27
@@ -680,4 +680,36 @@
                                          UIdType uid);
 
-#endif // MESSAGEVIEW_H
+// convert a string in UTF-8 into the string in the current encoding: of
+// course, this doesn't work in general as Unicode is not representable as an 8
+// bit charset but it works in some common cases and is better than no UTF-8
+// support at all
+//
+// FIXME this won't be needed when full Unicode support is available
+static wxFontEncoding ConvertUnicodeToSystem(wxString *strUtf)
+{
+   CHECK( strUtf, wxFONTENCODING_SYSTEM,
+          "NULL string in ConvertUnicodeToSystem" );
+
+   if ( !strUtf->empty() )
+   {
+      wxString str(strUtf->wc_str(wxConvUTF8), wxConvLocal);
+      if ( str.empty() )
+      {
+         // conversion failed - use original text (and display incorrectly,
+         // unfortunately)
+         wxLogDebug("conversion from UTF-8 to default encoding failed");
+      }
+      else
+      {
+         *strUtf = str;
+      }
+   }
 
+#if wxUSE_INTL
+   return wxLocale::GetSystemEncoding();
+#else // !wxUSE_INTL
+   return wxFONTENCODING_ISO8859_1;
+#endif // wxUSE_INTL/!wxUSE_INTL
+}
+
+#endif // MESSAGEVIEW_H


_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to