Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within I/O and Streams
Search Coderanch
Advance search
Google search
Register / Login
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
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
I/O and Streams
strange problem writing UTF8
Mathias Nilsson
Ranch Hand
Posts: 367
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi!
I have my data saved as unicode_general_ci in mysql
When I write the data to System.out everything looks ok
PrintStream out = new PrintStream( System.out, true , "UTF-8" );
I can see the greek characters. However, if i write it to file the encoding is MacRoman? I can't get it to UTF8?
BufferedWriter out = new BufferedWriter( new OutputStreamWriter( new FileOutputStream( "test.txt" ) , "UTF-8" ) );
can anyone help me with this?
SCJP1.4
Ulf Dittmer
Rancher
Posts: 43081
77
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Maybe the tool you're using to view it expects a
Byte Order Mark
? Or are the bytes in the file actually the MacRoman-encoded bytes (e.g. 9A for ö) ?
[ May 24, 2007: Message edited by: Ulf Dittmer ]
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Unicode character swallowing characters after it
How to display russian data properly using S.O.P
UTF-8 format error
An Unicode (UTF8 : right arrow ->) validation
Writing String Data to a File
More...