my dog learned polymorphism*
The moose likes Java in General and the fly likes Text Conversion between UTF-8 & ISO 8859-1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Text Conversion between UTF-8 & ISO 8859-1" Watch "Text Conversion between UTF-8 & ISO 8859-1" New topic

Text Conversion between UTF-8 & ISO 8859-1

Usman Riaz

Joined: Jun 10, 2005
Posts: 1
Hi *!
I have a web-application. The Frontend allows the user to upload a file (a csv file, containing some data). The frontend gets the file and puts the file into a String. Now the problem is the file can be using UTF8 encoding or ISO & normally it contains umlauts chars (above 127 code point) that are mapped differently on different code pages. Is there a way i can find the encoding of the file, just by the contents of the file???
Any help highly appreciated.
Thanks in Advance,
[ June 10, 2005: Message edited by: Usman Riaz ]
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

Count every character above 127 and estimate.
I agree. Here's the link:
subject: Text Conversion between UTF-8 & ISO 8859-1
Similar Threads
SAXException: Invalid byte 2 of 2-byte UTF-8 sequence
Start: applet not initialized
ISO-8859-2 and Struts
Unicode Char Problem
Head First Servlets and JSP - My first servlet Program is not running