ASP, MySQL and UTF-8

后端 未结 2 863
清歌不尽
清歌不尽 2021-01-06 05:43

First of all, I\'ve read almost all topics about this. I\'ve tried all advices but I couldn\'t solve this problem.

Here is the thing. I use Classic ASP and MySQL for

2条回答
  •  Happy的楠姐
    2021-01-06 06:26

    Even your connection should be UTF8. run this query before you run other queries

    set names 'utf8'
    

    SET NAMES indicates what character set the client will use to send SQL statements to the server. Thus, SET NAMES 'cp1251' tells the server, “future incoming messages from this client are in character set cp1251.” It also specifies the character set that the server should use for sending results back to the client. (For example, it indicates what character set to use for column values if you use a SELECT statement.)

    A SET NAMES 'x' statement is equivalent to these three statements:

    SET character_set_client = x;
    SET character_set_results = x;
    SET character_set_connection = x;
    

    FYI: manual

提交回复
热议问题