• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

problem with characters é,ã and º

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am facing a problem with characters é,ã and º in xml. when i parse the xml file with enocding as 'UTF-8' on linux machine, file is getting parsed and data saved in database by replacing above characters with ? . If I process the same file on windows i get the error saying "org.xml.sax.SAXParseException: Invalid byte 2 of 3-byte UTF-8 sequence." But i change the encoding to "ISO-8859-1" the file was parsed without any errors and data getting saved in db without replacing characters with ?.

é,ã and º characters are not in "UTF-8" character set ? or these characters belongs to "ISO-8859-1" character set?. I am hoping that above characters are not in UTF-8 list because I took the original file with special characters and created a new file as below

FileOutputStream fos = new FileOutputStream("C:\\test.xml");
Writer out = new OutputStreamWriter(fos, "UTF-8");
out.write(str);
out.close();

The generated file replaced the characters é,ã and º with é,ã and º. Why this is happening ?
Please help me out in finding the root cause. Thanks in advance.

Thanks.



  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!