Hmm... That gives &h00502151, which also doesn't ring any bells....
I've been finding out more about this string, and it seems as though
FileLocation->Length() returns 0. The length of the cstring is 19, and then
there's that weird encoding. I'm really stumped as to what is going on :-(
I was looking at the Length function...:
long REALstringStruct::Length(void)
{
if (this)
return mPrivateLength;
else
return 0;
}
....so could this mean that my REALstring doesn't actually have a length?
Dave.
> From: "Theodore H. Smith" <delete at elfdata dot com>
> Reply-To: REALbasic Plugins <realbasic-plugins at lists dot realsoftware dot
> com>
> Date: Fri, 27 Jan 2006 17:14:36 +0000
> To: REALbasic Plugins <realbasic-plugins at lists dot realsoftware dot com>
> Subject: Re: CFStrings on Win32
>
>
> 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>
_______________________________________________
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>
|