• 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

Filename in DBCS and JNI

 
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I have this strange problem. I have a filename, which is
passed as an argument to a native function. I used to
pass a String and convert this String to a UTF c-string
in the native function. Then I called fopen(...). All this
on Windows. Of course this didn't work when there were some
accented (e.g. German) characters in the filename.

My current solution is that I convert the String to byte[]
in Java using system default encoding and I am passing this
byte[] to the native function. Working nicely for filenames
with accents but I am worried that it won't work for double
byte character sets, like in Japanese Windows.

Any hints on how to solve this properly?

Thanks,
Petr
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic