Results 1 to 10 of 10

Thread: charset

  1. #1
    Join Date
    Jul 2007
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default charset

    in my PHP Mysql data base i have a table.
    the table field values are in UNICODE FONT. (eg:. எடுத்து காட்டு.) this is UNICODE TAMIL FONT. but when i retrive that same data from the table the output come like this ?????????????????????? . what is the problem. wht i have to do for this is there any collation type to display the UNICODE fonts correctly? i tried UTF8_UNICODE_ci collation.

    please sort out this problem.

    i tried by changing the php.ini file

    default_charset = "utf-8"

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    PHP doesn't handle multibyte characters well. There are some hacks to attempt to implement it (such as the mbstring extension) but it would be much easier to go with a different language.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Jul 2007
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    but, i get error only with the text which comes from database.
    in the same page. the other texts (static texts) are display correctly

  4. #4
    Join Date
    Jul 2007
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    when i see the database the text display correctly. when i get that same text in my php page it comes like "?????????????????????????????"

    in the same page i have same unicode static text they comes good in php

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Have you executed:
    Code:
    mysql_query('set names \'utf-8\'')
    before querying your database?
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #6
    Join Date
    Jul 2007
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thank you mr twey.

    i didnt do that. actually i dont know whts that.

    can u please tell me where i have to do that. how i have to excecute it plz tell me

  7. #7
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    It's a simple PHP statement... put it after connecting to your database and before executing your UTF-8 queries.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  8. #8
    Join Date
    Jul 2007
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thank you twey.

    i tried this also. but didnt get anything.

    iam entering datas directly in the database.
    the text in database table is correct.

    but when i retrive it in php page i get error.

    http://brownjoint.com/tamilsource/we...azine/test.php

    this is the link in this page

    "விளம்பரம்...." and "மனிதனின் தலையில்................................"

    both are static text whih i am getting correctly..


    in the right side top we have text like " ??????????????????? 1" and
    " ????????????? 2"

    this text iam getting from mysql data base. but in database this are "வணக்கம் 1" and " நன்றி 2"

    but when i get this text in php page in output it comes like "?????????? 1" and " ???????? 2"

    this is the exact problem.

    please tell me the problem. in mysql database i used utf8_general_collation,
    i changed my php.ini file default charset "utf8"

    still iam getting problem

  9. #9
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    iam entering datas directly in the database.
    Then I suspect you're entering them in the wrong character set. Have you checked the encoding on your terminal? If you're using Windows, I'm not sure how much you can do: DOS and cmd.exe are rather more limited.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  10. #10
    Join Date
    Jul 2007
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thanks twey.

    your previous answer is correct. mysql_query("SET NAMES 'utf8'");

    sorry i tried wrongly.

    thanks a lot for your help

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •