Displaying Chinese Character store in MySQL Database

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default Displaying Chinese Character store in MySQL Database

    Hi, is there anyone who know how to display chinese character store at MySQL
    database?

    I can display it correctly when using MS Access database. But when i switch to
    MySQL Datasource, chinese character will become square.

    When i view my data using MySQL Front in windows, I can see the chinese
    character there.

    For my coldfusion application, I set all encoding to UTF-8. it's set using
    setEncoding function, cfcontent, and cfprocessingdirective.

    Thanks for any help.

    Tiono

    Tiono Guest

  2. Similar Questions and Discussions

    1. Displaying Images from the Mysql Database
      Hi! everyone, i need help with displaying the images from the database. I successfully inserted an image to mysql database by converting it to...
    2. Chinese Character in Director?
      I am using English WinXP and English DirectorMX. I need to produce a Chinese-CD, and I am facing difficulties in embeding the fonts into director....
    3. Displaying & formatting text with mysql database
      I need some help with formatting some text received from a database query. I am only selecting a single row per query so the formatting will only...
    4. Displaying images from a MySQL Database
      Hi I'm have difficulty displaying images that are stored in a MySQL database. I've tried using the odbc.net provider, the ByteFX provider and the...
    5. How to store and display chinese in a web form?
      Hi Zhou, Is the field a unicode type? are you using the IME to input the chinese? Unicode types are "ntext" or "nvarchar". HTH ?? I've had...
  3. #2

    Default Re: Displaying Chinese Character stored in MySQLDatabase

    what version of mysql? what encoding did you use in your mysql db? did you add this to that dsn's connection string (if indeed you used utf-8)?

    using useUnicode=true&characterEncoding=utf8
    PaulH Guest

  4. #3

    Default Re: Displaying Chinese Character stored in MySQLDatabase

    i'm not sure what mysql version that i use. i think it's ver 3.2xxx. I must
    wait until i get home to check it. i'm running mysql in windows, so don't know
    how to set encoding use by database.

    where should i put the connection string? at textbox input in Add/Edit
    Datasource dialog of Coldfusion Administrator?

    I'll have to wait until i get home and test it all. So must wait until
    tomorrow for the test result.


    Thanks for your help.


    Tiono

    Tiono Guest

  5. #4

    Default Re: Displaying Chinese Character stored in MySQLDatabase

    3.2 is kind of old and doesn't support unicode (which i strongly urge you to
    use). 4.1 might be a better choice. mysql is kind of granular in it's encoding
    support, you can set the db,table, column to an encoding. for the db you might
    do something like

    CREATE DATABASE dayLateAndADollarShort DEFAULT CHARACTER SET utf8

    to get utf-8 for the whole db.

    the connection string goes in the connection string option under the advanced
    menu for that dsn.



    PaulH Guest

  6. #5

    Default Re: Displaying Chinese Character stored in MySQLDatabase

    I checked my MySQL Server version and it's version 3.2.53.

    I also try to execute SQL Statement from you "CREATE DATABASE
    dayLateAndADollarShort DEFAULT CHARACTER SET utf8" and got error in syntax.

    I'll download version 4.1 today and then give it a try.

    Thanks a lot for your help.

    Tiono

    Tiono Guest

  7. #6

    Default Re: Displaying Chinese Character stored in MySQLDatabase

    Hi Paul, I tried your hints, but it didn't work at my computer. I use MySQL
    4.1.7. alter my database and tables default character set to utf8. then put
    parameter to connection string in coldfusion data source admin page.

    when i view my page for chinese language, chinese character still get square
    box. when i switch back to MS Access database, chinese character display
    correctly.

    Is there another step that is needed to display chinese character stored MySQL
    database?

    Tiono Guest

  8. #7

    Default Re: Displaying Chinese Character stored in MySQLDatabase

    boxes mean the browser can't render that char, could be a font issue or
    slightly "off" encoding (and fyi "/" question marks mean the data is garbaged).

    once you set the database to utf-8 did you re-enter the data (i don't know but
    i don't think mysql will do teh conversion for you automatically)? and what
    driver are you using for access?

    PaulH Guest

  9. #8

    Default Re: Displaying Chinese Character stored in MySQLDatabase

    yes, i already reenter the data. The way that i reenter data is the same like i
    enter data to MS Access database. I'm using MS Access with unicode support for
    MS Access database Data Source.

    I think there can't be a font issue since i'm using the same CSS when testing
    with MS Access database. What i do is just switching between MS Access DSN and
    MySQL DSN.

    Btw, i'm using CFMX7 now in my installation.

    Tiono Guest

  10. #9

    Default Re: Displaying Chinese Character stored in MySQLDatabase

    hang on...are you sing the latest mysql JDBC drivers (as "other" in cfamdin)? then maybe [url]http://weblogs.macromedia.com/cantrell/archives/2005/02/utf8_mysql_41_a.cfm[/url] will be of some help.
    PaulH Guest

  11. #10

    Default Re: Displaying Chinese Character stored in MySQLDatabase

    Great, think I can get it work now, i hope :D

    i'll try it with MySQL Connector J JDBC driver later at home.

    thanks a lot for your help Paul.
    Tiono Guest

  12. #11

    Unhappy Re: Displaying Chinese Character store in MySQL Database

    Hi,

    I am new in programming with Coldfusion, I am writing a website in chinese.
    The chinese display in .cfm pages is fine but the dBase is "???"...

    My hosting company is using MySQL 5.0.82sp1 and my settings at mysql are as follows:

    Variable_name Value
    character_set_client utf8
    character_set_connection utf8
    character_set_database utf8
    character_set_filesystem binary
    character_set_results utf8
    character_set_server latin1
    character_set_system utf8
    character_sets_dir /usr/share/mysql/charsets/

    what is wrong int my setting?
    I have tried using <cfprocessingdirective pageencoding = "utf-8"> within body tags and with header, also <cfcontent type = "text/html charset = utf-8"> in the header...

    but not working. Tried a thousand times,...

    Some experts may help me? Thanks.
    carolhk is offline Junior Member
    Join Date
    Nov 2010
    Location
    hk
    Posts
    1

Posting Permissions

  • You may not post new threads
  • You may 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