Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: file to uri to file madness



Jerry,

I've had the same problem with greek characters, inconsistent decoding... any one know of a good decoding routine?

Thanks,

Larry

Jerry wrote:
It definitely looks like it's accent decomposition. I tried this code:

            testFile("\u00e9.html");
            testFile("\u00e9\u00e9.html");
            testFile("\u00e9\u00e9\u00e9.html");

            

            String[] files = new File(".").list();
            for ( int i = 0; i < files.length; i++ ) {
                String s = files[i];
                if ( s.endsWith(".html") )
                    testFile( s );
            }

    

    static void testFile( String s ) {
        System.out.println( s +": " + new File( s ).exists() );
        for ( int j = 0; j < s.length(); j++ )
            System.out.print( (int)s.charAt(j)+" " );
        System.out.println();
    }

and got the output (characters mangled by the Xcode console):

\216.html: true
233 46 104 116 109 108
\216\216.html: true
233 233 46 104 116 109 108
\216\216\216.html: false
233 233 233 46 104 116 109 108
e.html: true
101 46 104 116 109 108
e?.html: true
101 769 46 104 116 109 108
e?e?.html: true
101 769 101 769 46 104 116 109 108
e?e?e?.html: true
101 769 101 769 101 769 46 104 116 109 108

The composed accents from the original strings sometimes work and sometimes not, but if you list the files in the folder the names have decomposed accents and they work OK.

Jerry


_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden This email sent to email@hidden

-- 
 Larry Nussbaum Purgamentum init,
 email@hidden     exit purgamentum
 917/921-6547 (US)
 +61 404 482 544 (AU)
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: file to uri to file madness (From: François-Paul Servant <email@hidden>)
 >Re: file to uri to file madness (From: Jerry <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.