Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Encoding Problems

forums forums SQLyog Using SQLyog Encoding Problems

  • This topic is empty.
Viewing 6 reply threads
  • Author
    Posts
    • #12249
      ninoid
      Member

      Dear sqlyog comunity,

      I am using sqlyog and I am very satisfied.

      I write some code in java on my windows machine and when insert into mysql database i lost some characters.

      For example my string contains these characters: 'Č','č','Ć','ć','Đ','đ' and when I write them into database i got ???????

      But when I write these characters directly through sqlyog as table data and save hey encode correctly.

      My database charset is utf8 and collation is utf8_unicode_ci.

      Please help.

      All the best

      ninoid

    • #31932
      peterlaursen
      Participant

      Please read this: http://www.webyog.com/faq/content/34/152/en/my-special-characters-display-as-_noisy_-latin-characters-in-sqlyog.html

      It is not a problem with SQLyog. SQLyog displays what is stored in the database. If you dump such table and open in Notepad or a similar text-editor you will see the same garbling happen

      I am not very familiar with JAVA (and nobody at Webyog are as we do not use JAVA) but from your JAVA application you should handle the encoding of strings stored so that the client app sends encoded strings that match the charset for database/table/column where it is stored. You may SET NAMES but also JAVA may have some API/function to handle it.

      Maybe this will help: http://dev.mysql.com/doc/refman/5.1/en/connector-j-reference-charsets.html

    • #31933
      peterlaursen
      Participant

      this “match the charset for database/table/column where it is stored” should rather be “match the charset for for the connection and client”. MySQL can handle client charset different from charset used for storage.

    • #31934
      ninoid
      Member

      I didn't say tha sqlyog makes problems. On the contrary with sqlyog works great. When I write characters “ČčĆćĐđ” through sqlyog

      as table data and save them they encode correctly in mysql database.

      Problem is with my java app. So I am confused and I know that you are professionals so I write post here.

      I make database with sqlyog and set charset utf8, collation utf8_unicode_ci.

      Then I enter string “ČčĆćĐđ” in my Java app. I save to database and I got ??????

      I assume that java default charset for my string is utf8.

      Any idea?

    • #31935
      peterlaursen
      Participant

      I can only refer to the JDBC-connector documentation that I linked to before. I am sorry but we do not use JAVA with MySQL ourselves.

      Anyway you may try to

      1) Attach a small dump of such table (both structure and data).

      2) Execute “SHOW VARIABLES like '%character%';” on this server

    • #31936
      vishal.pr
      Member

      Hi ninoid,

      If it is a string hard coded inside the source making the problem, then it might be a file encoding problem with javac compiler. Make sure you use the proper command line to compile.

      This link may be helpful.

      http://www.example-code.com/java/java-utf8.asp

    • #31937
      ninoid
      Member

      Hi people.

      I found solution 😛

      Problem was in jdbc connection string.

      jdbc:mysql://localhost/some_db means that if encoding is not eyxplicitly specified jdbc will use deault system codepage.

      Therefroe in my case will convert java utf8 string to windows-1250 and send to mysql database with utf8 charset.

      But when I set connection string as jdbc:mysql://localhost/some_db?useUnicode=yes&characterEncoding=UTF-8

      jdbc will encode java string to utf8 and send to mysql database…

      THANKS TO ALL…

Viewing 6 reply threads
  • You must be logged in to reply to this topic.