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.
- 1Can't import songs and ones in library only play for 45 seconds 10-11
- 2Cant Get it to connect 10-11
- 3How do I print a list albums sorted by artist 10-11
- 4Is Mini DVI = Micro DVI?? 10-11
- 5Where are my apps for my iPad? 11-30
- 6Alternative to table EKBE... 11-30
- 7Error with new version of nokia ovi suite 11-30
- 8Changing the Selection Tool 11-30
- To position the cursor10/11
- Add js files to sharepoint page using sharepoint designer10/11
- Help setting up an ipod for a gift10/11
- Error with layers11/30
- PLS-00306,problem while executing procedure from oracle e_comerce11/30
- Windows media player issues with Live 2411/30
- Relation ships in atg11/30
- 2112 wlc + lap 1262 problem11/30
- Can't even uninstall11/30
- Calculate "remaining period" from key date and end-of-term11/30