+ 2
What does utf- 8 do?
2 odpowiedzi
+ 5
Because you've already been told what it is, I'll tell you why it's important: It affects the representation of the string in memory. If you're converting raw bytes into a string, you'll you need to know the original encoding in order to get the original string back.
Also, because it supports multi-byte characters, it can represent more than plain old ASCII can. If you're dealing with text from languages that don't use the Latin alphabet (or use combining characters) you'll want to use UTF-8.
+ 4
UTF-8 is a compromise character encoding that can be as compact as ASCII (if the file is just plain English text) but can also contain any unicode characters (with some increase in file size). UTF stands for Unicode Transformation Format. The '8' means it uses 8-bit blocks to represent a character.