1, the front desk Chinese passed to the background garbled,
Front desk does not need processing,
The system will generally convert Chinese to iso-8859-1 type by default,
Just accept the data in the background is handled
STR is the Chinese string sent by the front desk:
String Inputer = new String (Str.getbytes ("iso-8859-1"), "GB2312");
2, the front desk not only contains Chinese, but also contains special characters, if only in the background transcoding, more difficult. The use of the foreground transcoding, then the use of background decoding method of processing
Urldecoder.decode (Thevcorigin, "UTF-8");//Background decoding, parameters (the string to be decoded, what type of encoding needs to be translated)
String FilePath = Urlencoder.encode (FilePath, "Utf-8"); Java transcoding
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Page and background pass Chinese garbled problem (Java garbled)