Some things about the ASCII,Unicode and UTF-8

来源:互联网 发布:Windows 设置在哪里 编辑:程序博客网 时间:2024/06/07 11:08
  • 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.
原创粉丝点击