Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2006

Tip: Looking for answers? Try searching our database.

Special characters in File objects on macintosh

Thread view: 
jonfogh - 04 Jan 2006 15:10 GMT
Hi There

I have a problem with files containing some characters.

The file /Users/Test/æøåÆØÅ is handled by the io.File object, but
when calling getAbsolutpath on the object i get:
/Users/Test/æøa?ÆØA?

This means å becomes a? and Å becomes A?

Do somebody know why this happens and how to solve the problem?

Jon
Steve W. Jackson - 04 Jan 2006 17:55 GMT
> Hi There
>
[quoted text clipped - 9 lines]
>
> Jon

Whether or not it's a "problem" depends in large part on how you expect
to use the returned absolute path.

Longtime Mac developers know that absolute paths are generally not
useful for numerous reasons.  I haven't done much work with File objects
there in Java, but I know that some non-Java environments display the
file's name differently than they would when including it in an absolute
path string for encoding reasons.

So the question I would ask is whether the getName method on the File
object displays this same changed string as seen in the absolute path.  
If not, and if you truly need the absolute path, you might instead
consider traversing from the file, via its getParent method, up channel
to the root volume name.  You might also want to keep in mind that,
prior to Mac OS X 10.4, the boot volume was not available via /Volumes,
whereas in 10.4 there's automatically a symbolic link created under
/Volumes with the name of the boot volume.  That means, for instance,
that my PowerBook's "Macintosh HD" root directory can now be correctly
referred to as "/" or as "/Volumes/Macintosh HD/".

= Steve =
Signature

Steve W. Jackson
Montgomery, Alabama

jonfogh - 05 Jan 2006 08:11 GMT
The getName method returns the "encoded" value æøa?ÆØA? ...


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.