Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts

    Character Collations

    I have a database with languages. I have german-english, spanish-english, and latin-english tables, which provide translations.

    In phpMyAdmin when I browse the tables, the special characters show, such as ń÷Ř▀, but when I pull the data out, the letters are replaced with alternatives (▀ becomes ├č).

    I have tried setting the collation to utf-8-unicode, utf-8-general, latin1-german1-ci, and the default latin1-swedish-ci, both on the table and the individual row. What should they be set to, or is this an issue with PHP which is pulling out the data?
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,863
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Have a try by setting utf-8-general and then executing the following query before insertion and retrieval of data.
    PHP Code:
    mysql_query("SET NAMES 'utf8' "); 
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    It appears to still display the wrong characters, does this mean its not mysql?
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.

  • #4
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    It was encoded, perhaps by CodeIgniter, just needed to parse it with this

    PHP Code:
    mb_convert_encoding($data[$i][$entry], 'HTML-ENTITIES''UTF-8'
    Thanks!
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.


  •  

    Posting Permissions

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