UTF-16 and file names
On Windows (2K & XP atleast) you can have file names containing characters that are represented using UTF-16. E.g. The unicode character \ubf3f (decimal equivalent 48959). Below is a snippet of code that attempts to create a file containing this character.
File f = new File ("c:/temp", "\ubf3f.txt");
FileWriter w = new FileWriter(f);
And the result is the following:
java.io.FileNotFoundException: d:\temp\?.txt (The filename, directory name, or volume label syntax is incorrect)
at java.io.FileOutputStream.open(Native Method)
Clearly java is unable to interpret the file name. So I created the file on windows directly and it was fine. Then I tried to do a file.exists() test and it returned false. So either ways, I'm unable to work with this file in java.
Appreciate if some one can throw some light on why this is happening and what needs to be done to solve it.
AdvertisementForgot to mention that the java version is 1.3.1_03-b03. Before posting I searched the bug database but couldn't find something that was related. If some one finds it, please do post the bug number.
- 1Is there any way to do the following? Regarding score, and printing. 10-11
- 2Oracle Application Manager - Patching and Utilities 10-11
- 3Hello, question about T420 (i5-2520m) temperatur​e 10-11
- 4I am not able to execute the transport.send(message) 11-30
- 5Muvo tx fm driver prob 11-30
- 6Installation Failed. Adobe Genuine Software Verification failure. 11-30
- 7Will Pro Tools M-Powered 7.3 + Firewire 1814 work ok w new MacBook Pro? 11-30
- 8Add new LoadVar properties 11-30
- JTable containing checkbox column is not getting updated10/11
- How can I access a network harddisk from a OS9 Computer?10/11
- Need help embedding a mp3 player swf with xml playlist10/11
- HT1975 My location icon in the status bar never comes on even after trying everything. Location services are on but still cannot find my location in any app. :( HELP!10/11
- IOS 4.2.1 Playlist problem10/11
- SOAP BODY data to be Put into SOAP Header11/30
- Java.io.NotSerializableException: java.util.Hashtable$KeySet11/30
- Map Views in 11g11/30
- [IDCS2 Win]Indesign Crashes after Reading Swatches Panel!11/30
- Can you disable the Bounce Mail confirmation?11/30