I want to write to a file using the Charset API/UTF-8 encoding format. Basically I have a StringBuffer whose contents are in html/ASCII format. I want to use the Charset API and convert this to UTF-8 format and then write the o/p to a file. Any ideas on how to do this?
SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
posted 8 years ago
If the data is in ASCII, then you don't need to do any conversion - ASCII is a subset of Unicode. Just specify UTF-8 as encoding when writing the data to the file, and you should be all set.