Results 1 to 8 of 8
- 01-03-2010, 11:42 PM #1
Member
- Join Date
- Jan 2010
- Posts
- 9
- Rep Power
- 0
Create and Read Files with name including special characters (ñ, ü, é,)
Create and Read File Called ÑÜÍ.arc
Cordial Greetings:
How you can see the filename have a ñ (n with tilde, u with diaresis, etc )
I need create a file with the method.
String defDir = "/home/cepagi/Documents/"; //for Linux case
String defDir = "c:\\cepagi\Documents"; //for Windows case
String MyFileName = "ÑÜÍ.arc";
File file2 = new File(defDir+MyFileName);
o
FileOutputStream MyFileOutputStream = new FileOutputStream(defDir+MyFileName);
Later of created make a reference to he..
out.println("<a href=\""+defDir+MyFileName+"\">"+defDir+MyFileName +"</a><P>");
The problem is that my file is called"??????.arc" and can't no to access it.
__________________
Jose Luis Bernal ZambranoLast edited by joseluisbz; 01-03-2010 at 11:51 PM.
- 01-04-2010, 12:54 AM #2
Member
- Join Date
- Jan 2010
- Posts
- 13
- Rep Power
- 0
This is an encoding issue. Check the encoding of the output file.
I think your best bet is to ensure the encoding is UTF-8. But that also depends on what your requirements are on the output file encoding.
Hope this helps :-]
yanivby
- 01-04-2010, 02:59 AM #3
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Yes, that's the way. UNICODE support encoding have to use. UTF-8 is more prefer.
- 01-04-2010, 03:00 AM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
You can find lots of useful information from the Suns' official website.
Java Internationalization FAQ
- 01-06-2010, 12:47 AM #5
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Did you go through that link I've post in the previous post?
- 01-06-2010, 03:51 AM #6
Member
- Join Date
- Jan 2010
- Posts
- 9
- Rep Power
- 0
If you put link for help me...
Maybe I can't to see it...
"To view links or images in signatures your post count must be 10 or greater. You currently have 5 posts."
- 01-11-2010, 04:51 PM #7
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
http://java.sun.com/javase/technologies/core/basic/intl/faq.jsp
This is the link, copy-paste in your browser and see.
- 01-11-2010, 09:14 PM #8
Senior Member
- Join Date
- Dec 2009
- Location
- Belgrade, Serbia
- Posts
- 364
- Rep Power
- 4
Hola muchacho :)
This is not one but 10 questions :D
Ok let's get things clear.
First separate file creation, file-naming, file reading,
and file content representation in some program or browser.
We are talking about file encoding and using non ASCII chars like Ñ.
1. Can you create in your Java code editor,
in your file system,
on your OS,
simple file called ÑÜÍ.txt,
write some text in it
and open it later with any txt reading program?
EDITOR:
If you java code editor supports Unicode
you can write char Ñ like directly
otherwise you have to use
16bit Unicode escape char FOR EACH char like Ñ
min: '\u0000' = 0
max: '\uffff' = 65,535
EspaÑa is Espa\u00f1a
Try to create this file, write, and open it:
Java Code:public class SpainFileName { public static void main(String[] args) { String filePath = "C:\\temp\\ÑÜÍ.doc"; File file = new File(filePath); try { file.createNewFile(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
2. Representation of your file name and its content in JSP and HTML links
depends heavily on your browser settings and your JSP meta-tags
Name of coding schema is part of meta-tag in JSP for HTML file
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
Do little research on Spanish language and charset, and possibility to use
charset=utf-8
Check this in Mozzila Firefox
menu View => Character Encoding => Unicode (UTF-8)
...or something other?
take it easy
don't live a vida loca :)
Similar Threads
-
XML with special characters
By Kaizah in forum XMLReplies: 1Last Post: 11-06-2009, 02:26 PM -
How to index the special characters in Lucene
By talktoudaykumar in forum LuceneReplies: 2Last Post: 04-23-2009, 07:51 AM -
[SOLVED] special characters (ASCII) åäö
By AlejandroPe in forum New To JavaReplies: 8Last Post: 04-06-2009, 10:42 AM -
Searching for Microsoft special characters
By Tim McDaniel in forum EclipseReplies: 2Last Post: 02-24-2009, 03:11 PM -
special characters
By ravian in forum New To JavaReplies: 2Last Post: 11-16-2007, 01:28 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks