View Full Version : Special Character Issue
20 Dec 2011, 10:58 PM
Hi All ,
if i save ¿ this symbol in my grid , its saving but showing some extra symbol Â¿ . How can i avoid this . Please suggest me how can i reject junks .
21 Dec 2011, 12:37 AM
The symbol ¿ is Unicode character U+00BF. In UTF-8 that corresponds to the byte-pair C2 BF.
In ISO-8859-1 (Latin 1) the ¿ symbol is represented by the single byte BF. The byte C2 corresponds to Â.
So if we encode the character ¿ as UTF-8 bytes we get C2 BF. If we decode those same bytes as ISO-8859-1 we get Â¿.
console.log(encodeURIComponent('¿')); // logs '%C2%BF'
If your server then interprets this as ISO-8859-1 (which Java servers like Tomcat often do by default) then it will decode to Â¿. Figuring out how to configure your server correctly is beyond the scope of this forum but a quick bit of Googling should help.
If you include parameters in the POST body of a request then there is a standard encoding: everything uses UTF-8. On a number of projects where I couldn't control the encoding on the server I instead switched my requests to POST requests and it solved the problem. If you're saving data then you should be using POST instead of GET anyway.
Of course it may be nothing to do with the request parameters, it's possible the encoding issue happens elsewhere in your application.
Powered by vBulletin® Version 4.1.5 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.