• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Convert Chinese Name to english name in JSP page

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 28371
99
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic