• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Convert Chinese Name to english name in JSP page

 
ruba sampath
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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.

Thanks.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13073
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are going to have to find some web service that can perform this conversion and call it from your application. NOT by code inside your JSP but by a utility class that can be tested outside the servlet/jsp environment.

A google search for "convert chinese to english" found LOTS of services.

Bill

 
ruba sampath
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks for your reply. We are not using web services in our application. we have to fix this issue through JSP. Any idea?

Thanks.
 
Winston Gutkowski
Bartender
Pie
Posts: 10527
64
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ruba sampath wrote:We are not using web services in our application. we have to fix this issue through JSP.

Why? That answer simply doesn't make sense. Presumably you're using JSP because this application is web-based; so why not use an available Internet service?

Winston
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13073
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As many people on this forum will tell you, JSP is only for creating presentation, NOT computation. Therefore saying you are limited to JSP is silly. Fortunately the entire servlet API is available.

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.

Bill
 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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. So perhaps your question means something quite different than that.
 
Winston Gutkowski
Bartender
Pie
Posts: 10527
64
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Winston
 
ruba sampath
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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");


Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic