I. QT environment settings
Files from window upload to Ubuntu will display garbled, because the Ubuntu environment is set by default is utf-8,windows default is GBK.Windows environment, Qt Creator, menu-> tool-> options-> text editor-> behavior->
The file header contains BOM information (three bytes.The advantage is that the multi-encoding editor can correctly recognize the file encoding.
MicroSoft added ef bb bf three bytes before your own UTF-8 format text file,Notepad on
#include Note: multibyte includes GBK and UTF-8int Gbk2utf8 (char *szgbk,char *szutf8,int Len){Converts multibyte GBK (CP_ACP or ANSI) to wide characters first UTF-16The number of memory characters required after the conversion is obtainedint n =
As the saying goes, practice is the only standard to test truth, indeed. Oneself has been relatively lazy, although I think Daniel should be a notepad all done, but I still like to use DW or vs to write a good web page architecture, because always
ASCII encoding, which is the 256 characters required to display the text in English (e.g., English letters, numbers, punctuation marks, etc.), each character is represented by a byte, i.e. single-byte encoding ( SBCS , Char), the ASCII code table
Example code ..w.curl.html is as follows: (garbled !) {Code ...}
public function file_get(){ $file = file_get_contents('Curl.html'); iconv("ANSI", "UTF-8//IGNORE", $file); return empty($file) ? null : $file;
In gb2312 encoding, a Chinese character occupies 2 bytes, while in the UTF-8, a Chinese character occupies 3 bytes ". "UTF-8 encoding (in fact a unicode encoding) or Unicode encoding itself is supported, simplified Chinese characters. Traditional
Using Python for vs new project in Windows will use the default ANSI encoding (Chinese system: GB2312), if using Chinese cannot compileWorkaround:1. Advanced save with file to change the encoding format to Utf-8, but you need to do this every time
Today, because of the need to read the directory and files in Windows, fortunately before doing this work (see "Under Linux and Windows Traversal directory method and how to achieve a consistent operation", encapsulated in Windows and Linux read
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.