Professional Web Applications Themes

Cht driving me crazy! - MySQL

Hello! This is driving me crazy. I use php to query MySQL. Then the results are displayed on a webpage. All accented characters, umlauts, etc. are displayed incorrectly on the webpage. I included "echo mysql_client_encoding();" in the php script and it says the cht is latin1_swedish_ci. However, both phpMyAdmin and Navicat say that ALL chts are set to UTF8 at the server, database and table level. Where is this damn latin1 cht coming from? Any help will be appreciated. Thanks in advance. Diego...

  1. #1

    Default Cht driving me crazy!

    Hello!

    This is driving me crazy. I use php to query MySQL. Then the results
    are displayed on a webpage. All accented characters, umlauts, etc. are
    displayed incorrectly on the webpage. I included "echo
    mysql_client_encoding();" in the php script and it says the cht is
    latin1_swedish_ci. However, both phpMyAdmin and Navicat say that ALL
    chts are set to UTF8 at the server, database and table level. Where
    is this damn latin1 cht coming from? Any help will be appreciated.
    Thanks in advance.

    Diego

    correo@ironcito.com Guest

  2. #2

    Default Re: Cht driving me crazy!

    [email]correoironcito.com[/email] wrote:
    >
    > This is driving me crazy. I use php to query MySQL.
    What MySQL version do you use? What is the (default) character set
    (and collation) at server/database/table/column level?

    Which PHP extension do you use to connect to MySQL? The old 'mysql'
    extension does not know about character sets. Maybe you would like
    to switch to the (newer, better, bigger) 'mysqli' extension.
    > Then the results are displayed on a webpage.
    Do you set a 'content-type' header with character set information?
    What encoding do you use to store the data?
    > All accented characters, umlauts, etc. are
    > displayed incorrectly on the webpage.
    > both phpMyAdmin and Navicat say that ALL
    > chts are set to UTF8 at the server, database and table level.
    What does the database say (SHOW VARIABLES LIKE 'char%', SHOW CREATE
    TABLE ..., SHOW CREATE DATABASE ...)? More important - does your
    MySQL client specify a connection character set?

    Last not least: have you read the chapter on character set and
    collation support in MySQL?


    Fast recipe to avoid character set problems:

    1. store all strings in UTF8 encoding
    2. connect to the database with UTF8 connection setting
    3. emit a content-type header specifying UTF8 encoding


    XL
    Axel Schwenke Guest

  3. #3

    Default Re: Cht driving me crazy!

    Just as a side note. Apache by default encodes it's served web pages as
    latin1. That might be how your pages are coming out in the wrong
    encoding. That is if you are using apache.

    Kirk

    [email]correoironcito.com[/email] wrote:
    > Hello!
    >
    > This is driving me crazy. I use php to query MySQL. Then the results
    > are displayed on a webpage. All accented characters, umlauts, etc. are
    > displayed incorrectly on the webpage. I included "echo
    > mysql_client_encoding();" in the php script and it says the cht is
    > latin1_swedish_ci. However, both phpMyAdmin and Navicat say that ALL
    > chts are set to UTF8 at the server, database and table level. Where
    > is this damn latin1 cht coming from? Any help will be appreciated.
    > Thanks in advance.
    >
    > Diego
    >
    Kirk Kimmel Guest

Similar Threads

  1. Contribute Driving me Crazy!... Help!
    By TDHCharles in forum Macromedia Contribute General Discussion
    Replies: 2
    Last Post: August 21st, 03:37 PM
  2. InCopy driving me crazy
    By ooz@adobeforums.com in forum Adobe Indesign Macintosh
    Replies: 6
    Last Post: September 29th, 12:10 PM
  3. styles driving me crazy!
    By Jeff Justice in forum Macromedia Contribute General Discussion
    Replies: 0
    Last Post: June 16th, 07:00 PM
  4. CDONTS is driving me crazy. Please help !!!
    By owen in forum ASP Components
    Replies: 5
    Last Post: February 18th, 01:47 PM
  5. focusManager driving me CRAZY!
    By CylOlyc in forum Macromedia Flash Actionscript
    Replies: 0
    Last Post: February 16th, 08:11 PM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139