Forum


Notice to all users

We are migrating towards a new forum system located at community.teamspeak.com, as such this forum will become read-only on January 29, 2020

Results 1 to 7 of 7
  1. #1
    Join Date
    January 2009
    Location
    Germany
    Posts
    31

    Does TS3 write Latin1 Strings into UTF8 MySQL-DB?

    Hi,

    i have the feeling, that TS3 writes Latin1 encoded Strings into the UTF8 MySQL DB.
    Because, when i open a table with SQLyog or get a row with php. The strings are not
    in UTF8 chars, but Latin1!

    Name:  chars.jpg
Views: 306
Size:  68.4 KB

    Thanks
    Last edited by seriouz; March 2nd, 2011 at 01:15 AM.

  2. #2
    Join Date
    June 2008
    Posts
    18,507
    TS writes UTF8 into your databse, but Latin1 is a MYSQL setting from your database.
    When sending me private messages: Please make sure to include reference link to your forum thread or post.

    TeamSpeak FAQ || What should i report, when i open a client thread?

  3. #3
    Join Date
    August 2011
    Posts
    11
    Hi, what should I do to have UTF-8 encoded data in my MySQL database?
    The DB uses utf8_general_ci collation. And here are some variables:
    Code:
    character_set_client 	        utf8
    character_set_connection 	utf8
    character_set_filesystem 	binary
    character_set_results 	        utf8
    character_set_system 	        utf8
    collation_connection 	        utf8_general_ci

  4. #4
    Join Date
    January 2010
    Location
    Germany
    Posts
    2,029
    when using PHP make sure to set the Connection Encoding to UTF8 before writing / selecting anything from the Database.

    http://de3.php.net/manual/en/mysqli....r-set-name.php
    http://de3.php.net/mysql_set_charset

  5. #5
    Join Date
    August 2011
    Posts
    11
    Yes, I know it. But in my case I use
    Code:
    mysql_set_charset('cp1251');
    to get text in normal view. If I use
    Code:
    mysql_set_charset('utf8');
    I have non-correct text. I don't know what's wrong with the db, any ideas?
    How can I understand what charset/collation is used by TS3 server?

  6. #6
    Join Date
    January 2010
    Location
    Germany
    Posts
    2,029
    You have incorrect Text where? When you output it to the browser?
    If so keep in mind that you also need to send a Content-Type header in order to specify the Charset to be used by the browser, which will otherwise use whatever the system's default is (which obviously varies in different parts of the world).

    The Database Tables and Fields should all be utf8 and the entire Server & Client are using and expecting UTF8 encoded Strings all over the place.

  7. #7
    Join Date
    August 2011
    Posts
    11
    I use binary encoding to solve the problem. Using UTF-8 saves data incorrectly at the database.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [Resolved] UTF8 confusion
    By Meldric in forum Server Support
    Replies: 4
    Last Post: November 17th, 2014, 05:17 PM
  2. Problem with latin1!!! after conversation to mysql
    By ts_alpha in forum Server Support
    Replies: 4
    Last Post: August 17th, 2012, 03:53 PM
  3. How to let user message write in mysql database?
    By ts_alpha in forum Server Support
    Replies: 2
    Last Post: August 13th, 2012, 01:57 PM

Posting Permissions

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