In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains the "mysql CAPI interface reading Chinese garbled code problem how to solve", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's train of thought slowly in depth, together to study and learn "mysql CAPI interface read Chinese garbled problem how to solve" it!
In the recent yymysqlsdk open source project, the support for Chinese is not in place, so it took 1.5 days to analyze the situation of Chinese processing.
1. First confirm your mysql configuration file, my.ini (for configuration only). If not, add it.
[client]
Default-character-set=gbk (for the support of Chinese when developing client programs; if it is set to utf8 here, I have not verified it, and verify it later, )
[mysql]
Default-character-set=utf8
[mysqld]
Default-character-set=utf8
two。 Encoding attribute, select utf8, I am using naticat.
3. For tables, right-click to query the table information-"ddl, do you see a" ENGINE=InnoDB DEFAULT CHARSET=latin1; "?
By the way, this is the default encoding method used by naticat when designing the table. Please do not change this encoding method with the video. Latin1 is compatible with utf8 support (wild guess).
4. Then it is time to use vc to develop the client program. After real_connect, please execute the encoding setting, mysql_query (xxx, "set names latin1")
5. Look at the code.
View plain
Int rows = mysql_num_rows (res)
Int fields = mysql_num_fields (res)
For (int iTuno Bandi)
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.