Home > Back-end > Consult the Java connection mysql connection string in the characterEncoding=utf-8 is what mean? tha
Consult the Java connection mysql connection string in the characterEncoding=utf-8 is what mean? tha
Time:05-14
As follows: the utf-8 and GBK table said what? Read out data of the table in accordance with the GBK code? Or is it in accordance with the utf-8 read it out? DBURL="JDBC: mysql://localhost: 3306/" + dbname + "? UseSSL=false& ServerTimezone=Asia/Shanghai& CharacterEncoding=utf-8 "; DBURL="JDBC: mysql://localhost: 3306/" + dbname + "? UseSSL=false& ServerTimezone=Asia/Shanghai& GBK characterEncoding=";
CodePudding user response:
CharacterEncoding=role is to specify the processing characters of decoding and encoding format, or standard,
CodePudding user response:
As the upstairs said, if you specify different server code and, when the server will read and return, automatic to do encoding conversion, Again, you read from the local data, such as is GBK, if encoding and you specified is not the same, specifies the UTF8, for example, you have nothing to take the initiative to transfer from GBK code UTF8, it will cause the database data processing error,