PHP Code Conversion _php Tutorial

Source: Internet
Author: User
SELECT collationproperty (' Chinese_prc_stroke_ci_ai_ks_ws ', ' CodePage ')

Returns 936, which is the GBK encoding.

936 Simplified Chinese GBK
950 Traditional Chinese BIG5
437 US/Canada English
932 Japanese
949 Korean
866 Russian
65001 Unicode UFT-8

If the field is in Chinese and the PHP file setting is encoded as GBK2312, then there is no problem with database information:

Print_r ($rs ["Customer Code"]);

If the PHP file setting is encoded as Utf-8, an error is reported.

If you do not want to set the PHP file encoding to Utf-8, you need to convert the encoding:

Print_r ($rs [Mb_convert_encoding ("Customer Code", "GBK", "UTF-8")]);//print record array

There's no problem with that.

http://www.bkjia.com/PHPjc/326145.html www.bkjia.com true http://www.bkjia.com/PHPjc/326145.html techarticle SELECT collationproperty (' Chinese_prc_stroke_ci_ai_ks_ws ', ' CodePage ') returns 936, which is the GBK encoding. 936 Simplified Chinese GBK 950 Traditional Chinese BIG5 437 us/Canada English 932 Japanese ...

  • 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.