[PyQt] QString to str auto-conversion issue with SMP codepoints

Phil Thompson phil at riverbankcomputing.com
Sun Jan 5 12:56:31 GMT 2014


On 05-01-2014 3:00 am, Shriramana Sharma wrote:
> On Sun, Jan 5, 2014 at 3:36 AM, Phil Thompson
> <phil at riverbankcomputing.com> wrote:
>>
>>> Also, I presume you have also taken care of the reverse conversion
>>> i.e. a Python string having a trans-BMP char like \U00011005 would 
>>> be
>>> automatically converted to the surrogate pair when being sent to
>>> QString in C++/Qt, right? (Probably silly question...)
>>
>> There was no problem with that (as far as I know).
>
> OK fine I just checked that. But in converting from Qt to PyQt do you
> now (after yesterday's correction) leave unpaired surrogates as is
> (probably cannot come from widget but can come from
> textstream/datastream) or do you discard them?

They are kept as is. It does the same thing as QString::toUcs4().

Phil


More information about the PyQt mailing list