• Post Reply Bookmark Topic Watch Topic
  • New Topic

i want foriegn language support using jni.  RSS feed

 
ajay
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a situation wherein i need to support foriegn languages, e.g file names in french, that need to be passed to a native function (C) using jni, where i will be doing all kinds of operations on these files, e.g stat, ioctl, open etc.
I tried out the jni function GetStringUTFChars to get the file names in UTF format but this doesnt work for all files.
Is there a jni function that will do a conversion of all the known characters in UNICODE to the underlying platform (e.g linux) so that basic file system operations can be done on these converted files?

Thanks in advance,
austraind.
 
Alexandru Popescu
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If my memeory isn't completely wrong JNI use the notion of packed UTF (I guess you will find this in the JNI spec). Most probably you should do a convertion to ascii (or whatever you need) before invoking the native method.

--
./pope
[the_mindstorm]
 
Surasak Leenapongpanit
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the C language support UTF format?
 
Alexandru Popescu
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can use the wchar_t type (double byte char) i guess for this.

--
./pope
[the_mindstorm]
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
austraind austraind,
You might not be aware of the naming policy of the Ranch... You must use a reasonable name; i.e., firstname <space> lastname... you can change your display name here

Thanks...
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ali Pope:
you can use the wchar_t type (double byte char) i guess for this.


That supports only UTF-8, I guess... So it won't include Asian characters such as Chinese, Thai and so and so... I'm not sure if there is UTF-1 support in ANSI C...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!