Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Japanese characters in web application

by ezekiel (Pilgrim)
on Oct 17, 2003 at 04:53 UTC ( [id://299938]=perlquestion: print w/replies, xml ) Need Help??

ezekiel has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

I have a web application written in PERL (obviously) backed by a DB2 database. I want to explore the possibility of of extending the application so Japanese characters can be used in user entry and then displayed in the application

I know nothing about Japanese or Unicode. Can anyone recommend a good place to start? Are there particular CPAN modules I need? Is this kind of modification likely to be trivial or require extensive work?

Thanks for your help.

Replies are listed 'Best First'.
Re: Japanese characters in web application
by pg (Canon) on Oct 17, 2003 at 06:12 UTC

    That's not a problem, and generally speaking, you don't need any CPAN module to support unicode, as Perl core supports it.

    Obviously you need to learn more about unicode, and you can always come back with more specific questions. Luckily you don't need to learn anything about Japanese, as what you care is the encoding, not the language itself. From your point of view, a web page in Japanese, is just a stream of charactrers (numbers), in this sense, there is no difference between Japanese and English. Of course, the persons who provide and design the content need to know Japanese, but that's a different story.

    However, the way to enter Japanese characters and display them on screen is handled by the entry tool, browser, and OS, which are not part of Perl. Japanese characters are either entered thru special keyboard, or nowadays mostly thru special 'code' by using abc123's on an English keyboard. This 'code' is not the unicode we are talking about, but rather the code for each character to allow entering (typing).

    Display is not a problem, as most of the browsers support most of the main languages by default or by using plug-ins. Down to the bottom, displaying is just to translate a stream of predefined code into a stream of predefined pictures (group of pixels). Entering is either supported by OS, or by using free-dowloaded or paid tools (lots of tools support both Chinese and Japanese at the same time, as Japanese usese lots of Chinese characters), but that is what the user should be worry about not you. Don't worry, as those people read Japanese web pages, send email in Japanese ... have their own system set up already, as this is not the first time people see a page in Japanese in cyber world.

Re: Japanese characters in web application
by davido (Cardinal) on Oct 17, 2003 at 05:43 UTC
    Unicode is not an area that I have had occasion to delve into in any great depth. But I have read a few resources on the subject and can recommend them as a good place to start.

    You can start with perluniintro from the perldocs. I think it was introduced with Perl version 5.8.0, so you'll have to look at a recent release of Perl to find that POD. perluniintro seems to be a user-friendly introduction to Unicode as it pertains to Perl.

    Once you've digested that, you can go straight to the meat and potatos: perlunicode, also from the perldocs.

    As for modules, there are a plethora of them on CPAN. However, Unicode support is native to Perl in the more recent releases such as 5.8.0. You don't need a module to take advantage of the built-in support. However, as always, the modules on CPAN may serve to make your life easier as you identify specific needs. A quick search of http://search.cpan.org for unicode turned up a number of them under the Unicode:: namespace. Scan through the PODs for those modules and you'll have a pretty good idea of whether any of them might be of use to your endeavor.

    The official unicode home page is http://www.unicode.org. It has a lot of good articles on using unicode encoding.

    Good luck!


    Dave


    "If I had my life to do over again, I'd be a plumber." -- Albert Einstein
Re: Japanese characters in web application
by g00n (Hermit) on Oct 18, 2003 at 02:47 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://299938]
Approved by cLive ;-)
Front-paged by cLive ;-)
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (1)
As of 2024-04-25 01:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found