You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/08/05 09:04:33 UTC

[GitHub] [shardingsphere] taojintianxia commented on issue #11662: Chinese character garbled

taojintianxia commented on issue #11662:
URL: https://github.com/apache/shardingsphere/issues/11662#issuecomment-893292934


   following is the key part of the test application, written in PHP
   
   ```php
   $cset="GB2312";
   //$cset="UTF-8";
   header("Content-type:text/html;charset=$cset");
   
   
   
   
   function f_db_connection($host, $username, $passwd, $dbname, $port, $charset ) /*数据库连接*/
   {
       $connection = new mysqli($host, $username, $passwd, $dbname, $port );
       if ($connection->connect_errno) {
           printf("db_connection failed: %s \n host=%s ,username=%s, passwd=%s, dbname=%s \n", $connection->connect_error,$host,$username, $passwd, $dbname);
          // printf($port) ;
           exit();
       }
       mysqli_set_charset($connection, $charset);
       //mysqli_query($connection, "set names utf8");
       return $connection;
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org