File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Convert Chinese Name to english name in JSP page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Convert Chinese Name to english name in JSP page" Watch "Convert Chinese Name to english name in JSP page" New topic
Author

Convert Chinese Name to english name in JSP page

ruba sampath
Greenhorn

Joined: Jun 17, 2011
Posts: 28
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

Joined: Mar 22, 2000
Posts: 12803
    
    5
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

Joined: Jun 17, 2011
Posts: 28
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

Joined: Mar 17, 2011
Posts: 8008
    
  22

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


Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12803
    
    5
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
Bartender

Joined: Oct 14, 2005
Posts: 18655
    
    8

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

Joined: Mar 17, 2011
Posts: 8008
    
  22

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

Joined: Jun 17, 2011
Posts: 28
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Convert Chinese Name to english name in JSP page