liblouis / liblouis

Open-source braille translator and back-translator.
http://liblouis.io
GNU Lesser General Public License v2.1
259 stars 209 forks source link

en-ueb-g1.ctb back translation returns wrong inlen #583

Closed timothytylee closed 6 years ago

timothytylee commented 6 years ago

Steps to Reproduce Run the following code:

widechar *inbuf = "`>`>";
widechar outbuf[10];
int outpos[11];
int inlen = 4;
int outlen = 10;
lou_backTranslate("en-ueb-g1.ctb", inbuf, &inlen, outbuf, &outlen,
    NULL, NULL, outpos, NULL, NULL, 0);

Expected Result: inlen == 4

Actual Result: inlen == 2

Liblouis Version 3.5.0

bertfrees commented 6 years ago

What is outlen and outbuf in your example?

timothytylee commented 6 years ago

outlen == 2 outbuf == ">>" So this problem is not apparent from a call to lou_backTranslateString()

bertfrees commented 6 years ago

Fixed by https://github.com/liblouis/liblouis/pull/624 (https://github.com/liblouis/liblouis/pull/624/commits/aac37bf68968d2ede18dd4ed314bfbc1a78a3b2f).

egli commented 6 years ago

624 which fixes this has been merged