From: Paul K <pau...@ya...> - 2014-03-17 04:30:41
|
Hi John, I'd like to come back to this topic; maybe it's something I'm doing wrong and it's still possible to process those invalid UTF-8 characters? Any ideas? Paul. On Fri, Feb 21, 2014 at 4:53 PM, Paul K <pau...@ya...> wrote: > Hi John, > >> Yes, note that From8BitData() is static and To8BitData() is not. > > Thank you for the prompt change! Unfortunately, it didn't have the > desired effect for me; maybe I misread wxwidgets documentation. > > Let's say I have three invalid UTF-8 characters: string.char(0x80, > 0x81, 0x82). If I assigned them to a variable u, it has proper length > (#u == 3). If I try to add them to wxSTC, nothing happens (the length > of the content doesn't change). > > If I use From8BitData(), then I get 6 bytes instead of 3: > #wx.wxString.From8BitData(string.char(0x80, 0x81, 0x82)) == 6, but > this looks like "fixed" UTF-8 code. When I add the result to wxSTC, I > do get 6 bytes of content there, but that's not what I expected: I > expected three characters displayed with 0x80, 0x81, and 0x82 as their > codes. > > What am I doing wrong? > > Paul. > > On Wed, Feb 19, 2014 at 9:53 PM, John Labenski <jla...@gm...> wrote: >> On Wed, Feb 19, 2014 at 1:27 AM, Paul K <pau...@ya...> wrote: >>> >>> >>> Do we also get To8BitData(), as I may need it to save the data back to a >>> file? >>> >> >> Yes, note that From8BitData() is static and To8BitData() is not. >> >> Regards, >> John |