• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

i want foriegn language support using jni.

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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]
 
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does the C language support UTF format?
 
Alexandru Popescu
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can use the wchar_t type (double byte char) i guess for this.

--
./pope
[the_mindstorm]
 
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic