On 27 Jan 2006, at 17:00, Dave Addey wrote:
Hi Thomas,
I set about investigating the string in more detail, and here's a
thing - on
Mac, the encoding is reported as &h8000100 (=
kCFStringEncodingUTF8), but on
Win it is reported as 5316944 (that's an integer, not hex) which I
don't
recognise. I can't find it in the CoreFoundation headers, either.
Flip the bytes, and see what you get?
This is making me wonder more and more if the memory is a bit
screwed on
Win, perhaps due to the way I'm allocating it. Does anyone
recognise that
encoding as being valid?
Dave.
From: Thomas Tempelmann <listuser at tempel dot org>
Reply-To: REALbasic Plugins <realbasic-
plugins at lists dot realsoftware dot com>
Date: Fri, 27 Jan 2006 17:16:13 +0100
To: REALbasic Plugins <realbasic-plugins at lists dot realsoftware dot com>
Subject: Re: CFStrings on Win32
Dave Addey wrote:
const char *FileLocationCString =
inParameters->FileLocation->CString();
// this always returns a cstring with weird characters
Check the length - is it twice the size of what you expect?
then you have a unicode string made of 16 bit chars. In that
case, theo's on the right track: you may or may not need to
swap the bytes, and then tell the cfstring builder that you
are passing a utf16 string to it (thru the encoding parm, probably).
Thomas
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
--
http://elfdata.com/plugin/
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|