• Post Reply Bookmark Topic Watch Topic
  • New Topic

Filename in DBCS and JNI  RSS feed

 
Petr Blahos
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!