[liblouis-liblouisxml] Re: ctypes and bad trailing pad byte

  • From: Michael Whapples <mwhapples@xxxxxxx>
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Thu, 04 Feb 2010 10:43:28 +0000

On 02/04/2010 09:47 AM, Christian Egli wrote:
Michael Whapples<mwhapples@xxxxxxx>  writes:
Now this leaves the puzzling facts of why the different translation
result
I know this problem remains.

and why it only showed at the point of returning the function
(as seen the translation was obtained from the lou_translateString
call).
I don't quite understand what you mean here. Are you saying that
lou_translateString returns the correct translation and it is somehow
mangled at the point of the return of the louis.translateString function
in the Python bindings? I can't reproduce that effect.
No, I wasn't very clear by putting it all in one sentence, the two points 
looked related. What I meant was you get some sort of translation back from 
lou_translateString as you are able to print it inside the translateString 
(that file you attached), the problem only seemed to occur when the python 
function translateString returned. I would have imagined if typeform was not 
long enough for outlen then the problem would have occurred earlier when making 
the call to lou_translateString.

Having considered this further since writing the previous email, I can see how this might cause a problem, liblouis writes data in memory not allocated to it and so could alter data needed by python. If that is right then it leaves only the first point of why the differences between debug and standard python builds.

Michael Whapples


I'll write a small test case in C and see what the result is. According
to Christian Waldvogel there is some problem anyway with italics and
multiple words. Maybe it's a problem of the de-ch-g2.ctb table. But then
that wouldn't explain the different behavior of the python interface.
I'll get back to the list if I know more.

Thanks.

For a description of the software and to download it go to
http://www.jjb-software.com

Other related posts: