Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating File Name containg french characters using java.io.file

 
Sudhakar Duraiswamy
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Creating File Name containg french characters using java.io.file

When i try create a file containg french characters in UNIX environment they appear as ???

Is there a way to specify which Encoding to be used while creating the File ?



 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That depends on the editor/application you're using to create the file. Check its preferences. If the file is not pure ASCII, then you'll need the "-encoding" switch to tell javac which encoding it's in.
 
Sudhakar Duraiswamy
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guess what i even tried that when i try to compile the class in UNIX i get the below warnings

javac -encoding utf8 test.java




But when i compile it with ISO-8859-1 i dont get the warnings but still the issue persists .






Output:
File getting created as a result of the code in Unix is

852222_???_???_20090915.txt
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the actual encoding of the file?
 
Sudhakar Duraiswamy
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suppose you refer to the Java File ,If thats the it is 'Cp1252'
 
Paul Clapham
Sheriff
Pie
Posts: 20966
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can I clarify something? We're talking about the name of the file, not the contents of the file, correct?
 
Sudhakar Duraiswamy
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes indeed
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic