A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
OCA Java SE 8 Programmer I Study Guide 1Z0-808
this week in the
Retrieve non English symbols from request
Joined: Nov 20, 2008
Aug 10, 2010 11:38:05
Hello to all,
I would like to ask you for some help. I have GET form which submits data /parameters/
. So far so good... but the parameters data are not in English /actually in Cyrillic/.
So, how can I just write those parameters in a text file? What I have tried:
request.setCharacterEncoding("UTF8"); // here I've used many others encoding strings such as UTF-16, Cp1252... FileWriter file = new FileWriter("test.txt"); file.write(request.getParameter("F_Name")); // doesn't work. In the text file is like ????????? // so I decide to use OutputStreamWriter just to be able to change the stream encoding File f = new File("test.txt"); FileOutputStream fw = new FileOutputStream(f); OutputStreamWriter f_out = new OutputStreamWriter(fw,"Cp1252"); // I've used many others encodings as well // still the text file is like ????????
Does anyone have already been down this road?
I agree. Here's the link:
subject: Retrieve non English symbols from request
How to parse an XML document containing Chinese characters and get an XML bean
Output French Characters to a file
FileWriter & UTF-8 Encoding
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015