Hi.

Are about to launch a site using mysql database and PHP script to populate the webpages.

On this site users can set up their own internet site, by entering data in online forms that makes their site.

As it is now it supports ISO 8859-1 (Latin 1) languages.

It would be great it I could be able to make this site usable in other languages as well....!!!!

Can I without to much hassle make my site support more languages using Unicode? (Or any other way??)

I'm interested in:
1.
How do I make the generated webpages support Unicode?

2.
Do I have to do anything specific in PHP to make it work?

3.
Can I store directly into the mysql database without any changes in database setting, or is it not possible at all to use mysql?
(I'm not using any text sql search on text entered in the database!).

4.
Anything else that is important to know before converting my scripts, database, etc...?

Best

    Why do you need unicode? I've developed some multilanuage sites without any unicode. You need following:

    <meta http-equiv="Content-Type" content="text/html; charset=CHARSET">

    in your html code and

    header("Content-type: text/html; charset=CHARSET");

    in your PHP code, where CHARSET is charset for language, you want to use. You can store selected language un session or cookies.

      To IceD
      Hi and thanks for reply.

      Do I have to use BLOB fields to make this work with mysql?

      And as know it mysql db is set up to support one selected charset i.e. ISO 8859-1. Can I just store characters from other charsets if set up to support ISO 8859-1?

      And last: This might be tricky with how my site works.
      The members that are to build their website online using my site shall be able to either work with one or two languages at the same time. That is: if the user wants to populate his website in two languages then he will be prompted to fill out the fields for those two languages in the same HTML-form. So therefore I think unicode would do the trick.

        I suggest you to use "text" or "varchar" column type for storing text data. Now about mysql's charsets - you can insert texts in ANY language into mysql, but, e.g., if you manipulate with english, german and russian languages and have mysql charset set to german, you can get ALL data from te database, but sorting will work properly ONLY for english and german 🙁

        Now about input multilanguage data from the HTML form. It's really simple. You need only get data for each language from the form variables and insert them into database. But it's really impossible to correctly dispaly data in two or more languages in one HTML page 🙁

        If you need some sample code, feel free to mail me...

          Is there any way to display more than 2 languages in the same page using standard font ?
          like,Arabic,thai and english in the same page ?

            I think, no 🙁 But why d'you need to display two (or more) languages in one page? You can simply add buttons "In German", "In Arabic" into the page. BTW you can use unicode 😉, but a lot of browsers doesn't support it.

            TIP. Look at babelfish.altavista.com - maybe you find something useful there...

              Use the right tool for the job. Postgresql has excellent locale support and can handle multibyte character sets with ease.

                Have now managed to get it to work the way I want.

                I'm now able to both collect and display text in one or two different languages that does not normally work with ISO 8859-1 charset.

                In my html-pages that I want to be able to get and display UNICODE I insert this in the HEAD section:

                <META http-equiv="Content-Type" content="text/html; charset=utf-8">

                This works great I can now collect i.e. Russian and Romanian, Or Arabic and English in the same page, and to display one or two languages at a time in another page....

                BUT... in the page where I collect the data that is to be stored in the database I use both form-field type of input and form-field type of textarea.

                Textarea works and input does not.

                Does anyone know how to make input field to work with unicode or have a good workaround. It is not very good to use a textarea to collect a one line string of restricted lengt. (it has to be one line).

                Here is the example HTML code on textarea and input field used:

                Not working:
                <input type="text" name="txtInfTitle" value="<? echo $curInfTitle; ?>" size="50">

                Working:
                <textarea rows="1" name="txtInfTitle" cols="20" wrap="OFF"><? echo $curInfTitle; ?></textarea>

                Hope for a working feedback :-)

                Best

                  Write a Reply...