On Mar 29, 2012, at 7:47 PM, Wander Lairson Costa <wander.lair...@gmail.com>
wrote:
> 2012/3/29 Tormod Volden <lists.tor...@gmail.com>:
>> On Thu, Mar 29, 2012 at 12:32 PM, Wander Lairson Costa wrote:
>>> Yes, this is a known problem that was already reported before. PyUSB
>>> 0.4 was very flexible in managing the buffer types, and PyUSB 1.0 is
>>> not that so. I could not find yet a simple and elegant solution for
>>> this problem, but try to mimic to behavior of the C version of PyUSB.
>>
>> Thanks. I could not find it in the bug tracker, but I found a post
>> from Sarah Messer seeing the same problem here:
>> http://sourceforge.net/mailarchive/message.php?msg_id=27131804
>>
>
> There it is.
>
>> Maybe we should just try return array.array('c', data) before or after
>> trying array.array('u', data)?
>>
>
> This maybe a workaround for this specific case, but I mimic the
> behavior of the C version, things get more complicated. Anyway, if you
> provide a patch, I will accept, it is better than nothing.
>
>> BTW, how is the use of unicode strings meant to work? Each string
>> character LSB is sent to the device?
>>
>
> I don't remember for sure right now, but I think all bytes are sent as
> a linear buffer...
>
I Just read the Wikipedia page on utf-16 and the default is big endian if no
bom is present.
Although apparently windows defaults to little endian. In other words with
utf>8. I'd force a bom and output the data. Unless a byte order is specified.
The utf-16 decoder should understand the BOM as a zero width non breakable
space. And automatically do endian conversion based on the result of 0xFFFE or
0xFEFF.
> --
> Best Regards,
> Wander Lairson Costa
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> pyusb-users mailing list
> pyusb-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pyusb-users
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users