inserting utf-8

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rameshch45
    New Member
    • Oct 2007
    • 25

    inserting utf-8

    I have ensured my java program is taking and passing utf-8 into the mysql inserts but I see question marks in the database.

    I did a

    ALTER DATABASE dbname CHARACTER SET utf8 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT COLLATE utf8_general_ci ;

    AND

    ALTER TABLE users DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;

    But still the UTF character codes are not getting inserted? Anything obvious that I am missing?
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    Originally posted by rameshch45
    I have ensured my java program is taking and passing utf-8 into the mysql inserts but I see question marks in the database.
    What do you use to look at the database? How is that application set up in regard to character sets and encodings?

    Ronald

    Comment

    • rameshch45
      New Member
      • Oct 2007
      • 25

      #3
      I have read the documents and manuals but looks like am missing something.

      I use phpmyadmin to look at the data.

      I take a UTF-8 username in the registration screen and insert into the database. When the user tries to log in by supplying the same username, the characters in the database do not match (I have even seen that their codes are different).

      Comment

      • ronverdonk
        Recognized Expert Specialist
        • Jul 2006
        • 4259

        #4
        Are you using the SET NAMES command of MySQL before you INSERT or UPDATE? Like (in PHP)
        Code:
        mysql_query("SET NAMES 'UTF8'");
        Ronald

        Comment

        Working...