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.
- 1Some albums don't appear in finder (Pictures) 10-11
- 2Reading files from hard disk 10-11
- 3Is it possible to update my ipod 4g is to 6.1.3 if i have 4.3.5 because i keep getting the message error 10-11
- 4Is it necessary to have pages on mac to have it on iPad? 10-11
- 5Customer prices are not coming correctly!!! 10-11
- 6Vendor's list 10-11
- 7Flex 4.5.1 iOS project very slow 10-11
- 8Adding an image from the web to the report in the header with other Text 11-30
- Calendar colors on iPhone do not match colors in iCal10/11
- Error while importing technical systems in SLD10/11
- SQLite encrypted Database does not get attached Using Adobe Air,Why?10/11
- Multicam Frame Hold Issue in Premiere CC 8.0.1 - When Flattening10/11
- Zip'ing files from multiple folders to the same zip file10/11
- Import sites to a Mac that already has created its own iWeb sites10/11
- Clear Report Queue on local install11/30
- Creating a signature and Encrypt the file11/30
- Java io.exception errror11/30
- Adobe Captivate Error11/30