Convert japanese character to unicode equivalent

Posted on 2006-03-27
Last Modified: 2007-12-19
Hi Experts!

I have created a function to import data from a CSV file.  In connection with this, I need to store the data in its unicode equivalent but I have no idea on how to do it.  For sample data, kindly visit this site :

Any help is greatly appreciated...

Thanks in advance!
eNTRANCE2002 :-)
Question by:Renante Entera
    LVL 15

    Expert Comment

    Have a look here:

    If you download the class mentioned there and look in the example file it should be pretty self-explanatory.
    LVL 14

    Author Comment

    by:Renante Entera
    Hi nicholassolutions!

    First of all, thanks for your immediately reply.  Right now, I'm creating a basic and simple code using the said class but I couldn't get it to work perfectly.  Kindly refer back to the site I provided for the code...  What's wrong with the code I've made???

    I have already spend the whole day on resolving this issue but to no luck.  Huhuhu... :-((

    eNTRANCE2002 :-)
    LVL 15

    Accepted Solution

    try using

    $err = $converter->get_error();

    after you try the conversion. It seems that your input text is not in fact valid UTF-8 (I would guess you copied only part of the entire character -- it would be multiple ASCII characters, and some might not print, so you can't just cut and paste them).

    Try working directly on the data from your file, without cutting/pasting anything. The code you'd need is (assuming your UTF-8 Japanese text is in $utf8):

    require './class_unicode_converter_toolkit.php';
    $converter = new unicode_converter_toolkit();
    $html = $converter->convert($utf8);
    echo $html;

    LVL 15

    Expert Comment

    >>>Try working directly on the data from your file
    What I mean here is, import the data using your function, and convert it without looking at it. I have a feeling it will work when you do it directly.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Easy Project Management (No User Manual Required)

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Both Easy and Powerful How easy is PHP? (  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    The viewer will learn how to dynamically set the form action using jQuery.
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now