11-24-2023, 02:06 PM
UTF-8 uses one to four bytes to encode characters.
UTF-8 was designed for backward compatibility with ASCII
the first 128 characters are encoded using a single byte (8-bit) with the same binary value as ASCII
https://en.wikipedia.org/wiki/UTF-8
https://en.wikipedia.org/wiki/ASCII
Windows-1251 uses one byte (8-bit) to encode characters.
the first 128 characters have the same binary value as ASCII
https://www.ascii-code.com/CP1251
pass123 all these characters are ASCII
Thus, a file with these characters must be 7 bytes in size
regardless of whether it is saved in ASCII or UTF-8 or Windows-1251 format.
UTF-8 was designed for backward compatibility with ASCII
the first 128 characters are encoded using a single byte (8-bit) with the same binary value as ASCII
https://en.wikipedia.org/wiki/UTF-8
https://en.wikipedia.org/wiki/ASCII
Windows-1251 uses one byte (8-bit) to encode characters.
the first 128 characters have the same binary value as ASCII
https://www.ascii-code.com/CP1251
pass123 all these characters are ASCII
Thus, a file with these characters must be 7 bytes in size
regardless of whether it is saved in ASCII or UTF-8 or Windows-1251 format.