Re: Mac issue with drag/drop from a wxDataViewCtrl (possibly UTF16 encoded).

Tony Kennedy <[email protected]>
Newsgroups gmane.comp.lib.wxwindows.general
Message-ID <[email protected]>
I'm not sure what I'm actually receiving. I can get the string that I'm 
expecting if I modify the incoming data and removing all occurrences of 
zero. Not ideal, but I can move forward with this.

    wxString strTemp;
    wxString::const_iterator i;
    for (i = strData.begin(); i !=  strData  .end(); ++i)
    {
        wxUniChar uni_ch = *i;

        if ( uni_ch != 0)
            strTemp +=uni_ch;
    }
     strData  = strTemp;




On Thursday 10 October 2024 at 15:45:19 UTC+1 Christian Kristukat wrote:

> Hi Tony,
> from my experience with TextDataObjects on wxpython I can confirm that the 
> string is indeed UTF-16BE encoded. I have no experience with decoding in 
> C++ though, sorry.
> Christian
>
>
> El jue, 10 oct 2024 a la(s) 10:05 a.m., Tony Kennedy ([email protected]) 
> escribió:
>
>> Hi all,
>>
>> My code is really simple, and works fine on Windows. But on the Mac, I've 
>> got something strange going on.
>>
>> When the wxTextDataObject is created during my implementation of 
>> wxDataViewCtrl ::OnDragStart, the text I add to this is a tab delimited 
>> list, something like "aaa\tbbb".
>>
>> But when the text is dropped onto the target, I get
>> "a\0a\0a\0\t\b\0b\0b\0b" 
>>
>> I think somehow I'm getting a UTF16 encoded string, but I cannot seem to 
>> figure out how to convert it back to UTF8.
>>
>> Does anyone have any ideas?
>>
>> Thanks in advance,
>>
>> Tony.
>>
>> -- 
>> Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "wx-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/wx-users/15995df7-4023-49c0-85ae-f2d2535fb964n%40googlegroups.com 
>> <https://groups.google.com/d/msgid/wx-users/15995df7-4023-49c0-85ae-f2d2535fb964n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
--- 
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wx-users/f06b79fa-436f-45b4-b516-ae2e72c678can%40googlegroups.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.