I am using jsp with HTML page for my UI design. I need to convert traditional chinese name to english name while submitting the one form to another form. For example, if i enter chinese name in the input text box and after submitting the button it shown as ???. But i need it as a english name. I am getting the value in the jsp page using request.getParameter('*');
Could anyone please guide to resolve this issue.
A google search for "convert chinese to english" found LOTS of services.
The only non web service approach I can think of would require you to buy or build a database of Chinese names with english equivalents and install it locally.
Paul Clapham wrote:I don't even understand what it means to "convert a Chinese name to an English name". I have known quite a few Chinese people who all had English names, and I'm pretty sure that there wasn't an algorithm to convert their Chinese names to the English names they chose to be known by.
Even if it's simple transliteration, there's more than one system (Wade-Giles and Pinyin, to name but two). Personally, I hate all those 'Q's and 'Zh's you get with the official one.
I found a solution for this. We have to use getBytes to convert it:
for example :
String x = new String(request.getParameter("***").getBytes("ISO8859-1"),"UTF-8");