Tag Archives: unicode

How do I correctly decode unicode parameters passed to a servlet

Questions: Suppose I have: <a href=”http://www.yahoo.com/” target=”_yahoo” title=”Yahoo!™” onclick=”return gateway(this);”>Yahoo!</a> <script type=”text/javascript”> function gateway(lnk) { window.open(SERVLET + ‘?external_link=’ + encodeURIComponent(lnk.href) + ‘&external_target=’ + encodeURIComponent(lnk.target) + ‘&external_title=’ + encodeURIComponent(lnk.title)); return false; } </script> I have confirmed external_title gets encoded as Yahoo!%E2%84%A2 and passed to SERVLET. If in SERVLET I do: Writer writer = response.getWriter(); writer.write(request.getParameter(“external_title”)); I… Read More »

Convert escaped Unicode character back to actual character

Questions: I have the following value in a string variable in Java which has UTF-8 characters encoded like below Dodd\u2013Frank instead of Dodd–Frank (Assume that I don’t have control over how this value is assigned to this string variable) Now how do I convert (encode) it properly and store it back in a String variable?… Read More »

'Fill' Unicode characters in labels

Questions: How to ‘fill’ Unicode characters in labels in Swing? I’m trying to make a user interface for the chess program I’ve recently programmed (with chess pieces something like seen above). In it I’m using unicode characters to represent my chess pieces (\u2654 through \u265F). The problem is as follows: When I set the background… Read More »

How to store the data in unicode in hindi language

Questions: I am using PHP and MySQL for an application. Questions are: How to store data in MySQL नवीन खेतिहर उपकरण। readable format or निलेस र पà¥à¤¬ format When user enters data in a textbox and clicks on submit, at that time we get data in different format. What we need to do should we… Read More »

PHP decoding and encoding json with unicode characters

Questions: I have some json I need to decode, alter and then encode without messing up any characters. If I have a unicode character in a json string it will not decode. I’m not sure why since json.org says a string can contain: any-Unicode-character- except-“-or-\-or- control-character. But it doesn’t work in python either. {“Tag”:”Odómetro”} I… Read More »