Ask UTF8 and GBK encoding questions

Source: Internet
Author: User
Ask the UTF8 and GBK encoding questions. I wrote a project using zendstudio 10, which is UTF-8 encoded, but the database is GBK, leading to garbled code. I want to change the entire project file to GBK encoding. what is the fastest way?


Reply to discussion (solution)

Do not modify character sets for programs or databases.
You only need to notify mysql of the character set used after connecting to the database.
What is your current situation?
Mysql_query ("set names utf8 ");

Do not modify character sets for programs or databases.
You only need to notify mysql of the character set used after connecting to the database.
What is your current situation?
Mysql_query ("set names utf8 ");


I use pdo and oracle databases. what should I do?
I think of the following:
$ Db = "oci: dbname = // localhost: 1521/orcl; charset = zhs16gbk ";
$ Conn = new PDO ($ db, $ dbuser, $ dbpassword );
Is that true?

It seems that it is okay to write data to oracle. but can't I read data from Chinese? can I only use iconv?

Charset = zhs16gbk uses the gbk character set
Charset = utf-8, right?

I forgot it after a long time

Charset = zhs16gbk uses the gbk character set
Charset = utf-8, right?

I forgot it after a long time


Well .. It seems that no matter how you read or write it, you still need to take a look at the trouble ..

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.