• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

ASCII to UNICODE

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello!
I need to conver a string in ASCII to UNICODE using java. Please let me know if there is an easy way.
Thanks in advance.
Anish
 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The values for ASCII characters are the same values in Unicode. Java uses Unicode by default.
Angel
 
Anish Raj
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes.. it works in HTML ( HTML displays the same way for both ASCII and UNICODE) , But I am trying to create a PDF where it needs unicode. My ASCII characters are for a japanese lable and I am getting the ASCII as it is in the PDF where are if I put the UNICODE characters I am getting the correct japanese characters in my PDF.
Please let me know what you think.
Thanks a lot for your reply!
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I had problem when I needed to save text out to a file in UTF-8,
Internally all character data is represented as unicode but I had much problem saving to file as unicode. Got round it like this:
File f= new File(folder, fName);
InputStream in = new FileInputStream(f);
System.setProperty("file.encoding", "UTF-8");
String encoding = System.getProperty("file.encoding"); Reader r= new BufferedReader(new InputStreamReader(in, encoding));
Does that help?
reply
    Bookmark Topic Watch Topic
  • New Topic