Update of /cvsroot/mahogany/M/include
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16291/include

Modified Files:
        strutil.h 
Log Message:
use new ConvertUTFToMB() instead of ConvertUnicodeToSystem(): it now tries to guess 
the correct encoding for UTF text

Index: strutil.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/strutil.h,v
retrieving revision 1.73
retrieving revision 1.74
diff -b -u -2 -r1.73 -r1.74
--- strutil.h   14 Jul 2004 16:17:07 -0000      1.73
+++ strutil.h   22 Sep 2004 22:03:27 -0000      1.74
@@ -342,14 +342,21 @@
 
 /**
-  Try to convert text in UTF-8 or 7 to the current encoding (the conversion is
-  done in place)
+  Try to convert text in UTF-8 or 7 to a multibye encoding.
 
-  @param strUtf string containing UTF text on input, ASCII text on output
+  The conversion is done in place, i.e. the str parameter is read and written
+  by the function.
+
+  We try to detect the output encoding automatically by analysing the Unicode
+  text and selecting a code page which contains the first non ASCII character
+  in it. Of course, this does mean that Unicode characters from any other code
+  page are not going to be represented correctly, but this is still better than
+  no Unicode support at all.
+
+  @param str string containing UTF text on input, ASCII text on output
   @param utfEnc specifies if it is in UTF-7 or UTF-8
   @return the encoding of the returned string
  */
 extern wxFontEncoding
-ConvertUnicodeToSystem(wxString *strUtf,
-                       wxFontEncoding utfEnc = wxFONTENCODING_UTF8);
+ConvertUTFToMB(wxString *str, wxFontEncoding utfEnc = wxFONTENCODING_UTF8);
 
 // return the length of the line terminator if we're at the end of line or 0



-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to