Having some problems related to the differences between UTF-8, UTF-16, ASCII and ANSI. After some research, I have an idea, but it would be very helpful if someone could accurately explain the difference between them (including representing the bytes of a typical character from each).
I want my question to come down to
1) How do each of the above store characters as bytes 2) What are the differences between the above standards 3) What is a code page 4) Method of converting characters between the various types.
Many thanks:)
I found Joel's article in Unicode to explain this very well. In particular, it covers history (essential for this subject), encodings (UTF-8/16, etc.) and code pages.
.
1: . .
2: .
ASCII128 .
ANSI, ASCII, . .
UTF-8. Unicode, ASCII. - .
UTF-16UTF-8, - 16 . , 8 .
3: - , , ( ) . Unicode , . ANSI , 256 . , , , , .
4: , , ( ). . UTF-8 ASCII, 128 , , ASCII.
ad-hoc, , .
, Unicode ( !) ( Joel Software)
O'Reilly CJKV : CJKV, . " ! *! ** # @Euro, ?".
Unix recode iconv iconv (man 3 iconv) C ++.
recode
iconv
man 3 iconv
Perl, Encode (, use Encode; print encode("utf-8", "\xabfoo")). Python, unicode.encode / str.decode (, print u'\xabfoo'.encode('utf-8')).
Encode
use Encode; print encode("utf-8", "\xabfoo")
unicode.encode
str.decode
print u'\xabfoo'.encode('utf-8')
, :
UTF-8 ASCII , 127 ASCII UTF-8 ( UTF, ). , ASCII , ASCII UTF-8 .
, UTF-8 - ; " 127 . , . , ASCII ? : a , n 1 , n .
, , , . , , , , . !
UTF-8 is also the standard for XML.
Source: https://habr.com/ru/post/1708808/More articles:ΠΠ΄ΠΈΠ½ΠΈΡΠ½ΠΎΠ΅ ΡΠ΅ΡΡΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ Ρ Π½ΠΎΡΠΎΠΌ: ΡΠ΅ΡΡΡ Π²ΠΎ Π²ΡΠ΅ΠΌΡ ΠΊΠΎΠΌΠΏΠΈΠ»ΡΡΠΈΠΈ? - pythonΠΌΠΎΠΆΠ½ΠΎ Π»ΠΈ ΠΎΡΠΊΠ»ΡΡΠΈΡΡ ΠΏΠΎΠ²Π΅Π΄Π΅Π½ΠΈΠ΅ ΠΎΡΠΏΡΠ°Π²ΠΊΠΈ ΠΊΠ½ΠΎΠΏΠΊΠΈ Π½Π° ΡΡΠΎΡΠΎΠ½Π΅ ΡΠ΅ΡΠ²Π΅ΡΠ° Ρ ΠΏΠΎΠΌΠΎΡΡΡ Javascript - javascriptHow to create a downloadable file created using XmlDocument () - xmlfiles get into the wrong directory after svn copy - svnHow to update the Windows 7 start menu from the NSIS installer? - nsisHow to increase WPF application performance - performanceHow can I guarantee that the ajax response will be cached? - jqueryHow do I switch the Emacs split screen where one screen is an editor and the other is a terminal emulator? - emacsProblem removing table rows added using jQuery - jqueryCheck Socket File Descriptor? - cAll Articles