本文主要是介绍Some things about the ASCII,Unicode and UTF-8,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
- ASCII: 1 byte,just can cover 255 characters,usually used in pure English text.
- Unicode:ASCII can’t cover many other type’s words. Unicode uniform all of the words to the same rule.Usually it is consist of 2 bytes and sometimes more
- UTF-8:
– Unicode will cost much memory and usually Unicode will cost 2 times memory compared with ASCII.So UTF-8 was created.UTF-8 will code the charactor to 1~6 bytes depend on the charactor.For example,English word will be 1 byte and a chinese word usually will be 3 bytes.
– UTF-8 can also suppot the ASCII.So some old softwares that just can support the ASCII also can work with the UTF-8
– the PC’s memory will store the data with Unicode in order to support all of the words and will be stored with UTF-8 in the desk
– If you are doing work in the notepad,the words will be the Unicode.Then you save the file to the disk,the data will be transformed to UTF-8
– the C/S also do the same work.when you are watching the web.the server will create the web page with Unicode,and change it to UTF-8 when sending the data to the client.The client also return the data to the Unicode and show the page on the browser.
这篇关于Some things about the ASCII,Unicode and UTF-8的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!