[BRLTTY] Fwd: Orca crash with grade 2 and latest versions of brltty and liblouis

Michael Whapples mwhapples at aim.com
Thu Jul 2 18:37:53 EDT 2009


I don't know what is the best way to check it, but here are some thoughts:
Python code can find out whether UCS2 or UCS4 is used in python by doing

 >>> import sys
 >>> sys.maxunicode

If that returns something larger than 65536 (I hope I got the number 
right there) then you have a python using UCS4 otherwise its using UCS2.

You may be able to find out the information from one of the python 
header files but using those is not something I fancy doing.

Should liblouis compile to meet python's unicode? What if the user 
initially installs liblouis without python and then decides to add 
python. As the bindings are not compiled as they use ctypes then I would 
imagine really the bindings should try and handle things. However 
ideally liblouis would then use UTF-16 and UTF-32 for communication 
rather than UCS2 and UCS4 as it would ease the task for the bindings 
handling this (from what I read the difference of UCS2 and UTF-16 is 
that UCS2 is limited to 16-bits but UTF-16 is a variable length encoding 
allowing all characters in unicode 32-bits). The reasons it would ease 
the task for the bindings is that python has encoders and decoders for 
UTF-16 and UTF-32 (eg. u'Hello'.encode("UTF-16") ) and there would be no 
question of characters not representable in UTF-16 (which could happen 
if using an UCS4 python converting to UCS2).

Anyway that's probably enough from me describing what I don't like about 
trying to interface with liblouis, particularly as this is the brltty 
list, may be I will pass on some of the stuff covered in this to John.

Michael Whapples
On 02/07/09 23:00, Samuel Thibault wrote:
> Michael Whapples, le Thu 02 Jul 2009 22:28:04 +0100, a écrit :
>    
>> on the liblouis stuff, if liblouis is compiled for ucs2 (I believe UCS2
>> is liblouis's default) then you need a UCS2 compiled version of python.
>> If you use an UCS4 compiled version of liblouis then you need an UCS4
>> compiled version of python. Mixing the two (IE. UCS2 liblouis and UCS4
>> python or vice versa) you will get very odd results, may be even crash
>> python, and if python survives then brltty will struggle with the output
>> as it is very likely that it won't be valid.
>>      
> Ouch.  Can't liblouis detect which way python was compiled at
> ./configure time?
>
> Samuel
> _______________________________________________
> This message was sent via the BRLTTY mailing list.
> To post a message, send an e-mail to: BRLTTY at mielke.cc
> For general information, go to: http://mielke.cc/mailman/listinfo/brltty
>    



More information about the BRLTTY mailing list