Thanks, I will look at all that this
morning
*** this signature added by listserv *** *** Visit http://www.listserv.dfn.de/archives/vswe-l.html *** *** for archive browsing and VSWE-L membership management *** |
In reply to this post by Jon Raiford
Thanks to you all, it is finally working, I've got
my accents right.
UnicodeString fromUTF8Content:
aByteArray (where aByteArray is the result
of my mySQL query)
fromUTF8Content: aByteArrayOrString
"Answer a new instance of the receiver containing the same characters as the <aByteArrayOrString> argument. Implementation Note: CP_ACP is the only code page supported by Win95." | answer answerSize |
aByteArrayOrString isEmpty ifTrue:
[^UnicodeString new].
answer := self new: aByteArrayOrString size * 8. (answerSize := KernelLibrary
multiByteToWideCharCp: 65001 "CP_UTF8" flags: 0 lpstr: aByteArrayOrString cchstr: aByteArrayOrString size lpwstr: answer cchwstr: answer basicSize) == 0 ifTrue: [^KernelLibrary default systemError]. ^answer copyFrom: 1 to: answerSize *** this signature added by listserv *** *** Visit http://www.listserv.dfn.de/archives/vswe-l.html *** *** for archive browsing and VSWE-L membership management *** |
In reply to this post by Chantal Thibodeau
Small correction, the sample was
troncated
change last line by
^ (UnicodeStringBuffer stringFromUnicode:
answer length: answerSize) asString
*** this signature added by listserv *** *** Visit http://www.listserv.dfn.de/archives/vswe-l.html *** *** for archive browsing and VSWE-L membership management *** |
Free forum by Nabble | Edit this page |