[Advanced-java] Files with scandic letters in their names

KCE kurt at searchbug.com
Tue Jul 8 15:55:22 2003


Here's a thought.  (And you might want to check this out 
by dumping the filename to a swing component or 
something.)
Suppose your java source is in ascii.  That means, when 
you type the string "ä" you are really typing ascii 
character 132.  Now, that may be being directly translated 
to the unicode character \u0084(check my math on this) and 
not \u00e4 as it should be. 

Its an easy mistake to make too (here's the kicker) the 
compiler author may have assumed that since the first 
128bits ascii directly maps to the first 128bits unicode, 
they could pad each string character with 0x00 and get the 
unicode character. It works great for strings like 
"aaaooo.txt", but when somebody uses the extended ascii 
chars, things get hurt.

Like I say, this is all speculation.  You may want to try 
it first.

>> File file = new
>> File("c:\\projects\\test\\ääääööö.txt");
>> if (file.isFile() == false) {
>> 	System.out.println("THIS IS NOT FILE");
>> }
>>
>_______________________________________________
>Advanced-java mailing list
>Advanced-java@lists.xcf.berkeley.edu
>http://lists.xcf.berkeley.edu/mailman/listinfo/advanced-java

 
 
______________________________________________________
Find People and Businesses at http://www.SearchBug.com
Innovative Messaging Solutions by GMSI, http://www.gmsi1.com