[liblouis-liblouisxml] Re: Issue 15 in liblouis: Python wchar_t and UTF-16 mismatch

  • From: Michael Whapples <mwhapples@xxxxxxx>
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Wed, 11 May 2011 23:35:51 +0100

I believe there is a function call now available for getting the size of 
widechar, however that will not work if there is an old version of liblouis 
installed.

Regarding converting from 16-bit and 32-bit unicode, in jlouis I used the 
utf-16 and utf-32 encodings. However I do caution the use of that system as 
liblouis uses ucs-2 not utf-16 (ucs-2 is a fixed 2 byte encoding where as 
utf-16 is variable length so can accept characters which require 4 bytes to 
represent, I don't know what would happen if such a character were passed to 
liblouis).
On 11 May 2011, at 22:39, liblouis@xxxxxxxxxxxxxx wrote:

> 
> Comment #1 on issue 15 by ja...@xxxxxxxxxxxx: Python wchar_t and UTF-16 
> mismatch
> http://code.google.com/p/liblouis/issues/detail?id=15
> 
> I realise liblouis allows the widechar size to be configured separately, but 
> why would you want to compile for 16 bit widechars on a system which has a 32 
> bit wchar_t?
> 
> If we do indeed need to support this, we're going to need two things:
> 1. A way to programmatically determine what widechar size liblouis was 
> compiled with; and
> 2. A way to handle the alternative widechar type in ctypes, which (as far as 
> I can tell) only handles wchar_t and char out of the box. I'm not sure how to 
> do this or if it's even possible. ctypes does provide functionality to 
> convert between C and Python types, so it should be possible, but I'm not 
> certain.
> 
> For a description of the software, to download it and links to
> project pages go to http://www.abilitiessoft.com

For a description of the software, to download it and links to
project pages go to http://www.abilitiessoft.com

Other related posts: