[liblouis-liblouisxml] Re: Using liblouis within an Android app.

  • From: Dave Mielke <dave@xxxxxxxxx>
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Wed, 6 Jan 2016 08:39:40 -0500

[quoted lines by Michael Whapples on 2016/01/06 at 13:20 +0000]

Also I still question that sizeof is not really as dynamic as you
suggest. The size of widechar is still determined by how you compile
your JNI code (IE. its from including the liblouis.h file which
specifies the size of widechar) and sizeof only makes it available as
a value for use in variables. You would still need to compile
different versions for 16-bit or 32-bit unicode versions of liblouis.

No, not at all. Just declare, in C, an array of widechars. That's all. The
conversion to/from UTF-16, which Java uses, needs to be coded anyway. The
native array just needs to be an array of widechars. No check needs to be done
at all. Not even sizeof, actually.

Now, let's say that liblouis uses UTF-16. Then, yes, a check would need to be
made. Still, it'd just be an if statement with a then and an else clause. No
need for differently compiled versions of the code.

--
Dave Mielke | 2213 Fox Crescent | The Bible is the very Word of God.
Phone: 1-613-726-0014 | Ottawa, Ontario | http://Mielke.cc/bible/
EMail: Dave@xxxxxxxxx | Canada K2A 1H7 | http://FamilyRadio.org/
For a description of the software, to download it and links to
project pages go to http://liblouis.org

Other related posts: