MYSQL conversion code Solution

Source: Internet
Author: User

MYSQL conversion coding solution 1. Obtain the hexadecimal encoding mysql> SELECT hex (CONVERT ('tourists' USING gbk) under gbk of the Chinese 'tourists' in mysql of utf8 )); -> D3CEBFCD www.2cto.com reversed gbk hexadecimal encoding and retrieved Chinese mysql> select convert (unhex ('d3cebfcd') USING gbk ); -> 'tourists' hexadecimal encoding is directly converted from gbk's hexadecimal encoding to utf8's hexadecimal encoding mysql> select hex (CONVERT (unhex ('d3cebfcd') USING gbk) USING utf8 )); -> 'e6b8b8e5aea2 '2. If www.2cto.com obtains the hexadecimal mysql encoding for gbk of the Chinese 'tourists' in gbk, SELECT hex ('tourists '); -> D3 CEBFCD reversed the gbk hexadecimal encoding and retrieved the Chinese mysql> unhex ('d3cebfcd');-> the principle of 'tourists' is known, you can write a small program to replace the code. Note that 0x must be added to the header in hexadecimal text, for example, 0xD3CEBFCD.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.