openMSX / wxcatapult

23 stars 4 forks source link

[Bug] wxCatapult: assorted wxString/UTF-8 stuff [sf#487] #20

Closed openMSX-import closed 9 years ago

openMSX-import commented 9 years ago

Reported by joxy on 2013-07-30 16:50 UTC

+assert(len>=0);
-temp =  wxString((const wxChar*)wxCSConv(wxT("ISO8859-1")).cMB2WX((const char*)chars), len);
-parser->parseResult.contents.Append(temp.Left(len));
+charsAsWxString =  wxString((const char*)chars, wxConvUTF8, (size_t) len);
+parser->parseResult.contents.Append(charsAsWxString);

Wouter writes: There are more places in the code that convert from ISO8859-1 instead of UTF-8. Could you take a look at those as well? Thanks.

openMSX-import commented 9 years ago

Commented by joxy on 2013-08-02 08:37 UTC found 3 places with ISO8859 . changed all to UTF-8. Also fixed Left call with a correct byte vs character handling.

openMSX-import commented 9 years ago

Commented by joxy on 2013-08-02 08:38 UTC tested on linux, tests on vc32 and mingw32 pending.

openMSX-import commented 9 years ago

Commented by joxy on 2013-08-02 10:05 UTC tested on mingw32.

openMSX-import commented 9 years ago

Commented by joxy on 2013-08-02 10:17 UTC tested on vc32.

Found 0 refs to wxConvISO8859_1 in wxCatapult code.

Closing this issue.

openMSX-import commented 9 years ago

Commented by joxy on 2013-08-02 10:18 UTC Passing wxString by ref is a FR, not a bug. Moving it to "assorted stuff FR".

openMSX-import commented 9 years ago

Commented by joxy on 2013-08-02 10:19 UTC

Diff:


--- old
+++ new
@@ -6,6 +6,4 @@
 +parser->parseResult.contents.Append(charsAsWxString);

-1. Wouter writes: There are more places in the code that convert from ISO8859-1 instead of UTF-8. Could you take a look at those as well? Thanks.

-2. (low priority) currently all wxString parameters are passed by value, in many cases it's better to instead pass 'const wxString&' parameters. +Wouter writes: There are more places in the code that convert from ISO8859-1 instead of UTF-8. Could you take a look at those as well? Thanks.


- **status**: open --> closed-fixed