🙏 Please consider SUBSCRIBING !!! 🧧 Patreon Donations: / theflask
Click "SHOW MORE" below to see the cool guides !!! 😎
Byte String vs. Character String
References:
https://stackoverflow.com/questions/6...
https://en.wikipedia.org/wiki/Unicode
https://en.wikipedia.org/wiki/Video_c...
https://en.wikipedia.org/wiki/Audio_c...
https://mcdlr.com/utf-8/#12376
https://docs.python.org/2.4/lib/stand...
Byte String vs. Character String
BINARY, VARBINARY - String Data Types
Blob Data Type - CHAR, VARCHAR, TEXT
BLOB - "Binary Large Object"
TLDR: In a nutshell "binary" is for computers to understand and
"characters" are for humans to understand.
bit - "1" and "0", 1 byte is just composed of 8 bits.
the "atomic" level of a computer's data organization
byte string - The only thing that a computer can store to its memory is
called a byte or byte string. For example a character
is actually "encoded" to a byte so that a computer
can understand and use it.
character string - is an "abstraction" from the byte string and is "decoded"
so that a human can understand it.
character encoding or "encode" - a set of rules how to store data that a
computer can understand.
character decoding or "decode" - a set of rules how to extract data
(the byte string) that a human can understand,
the reverse of "encode".
Unicode - is the standardization of the character encoding and decoding
wherein all computer manufacturers, software companies agreed upon
to have a consistent rule.
Unicode can be implemented by different character encodings or
so called "CHARACTER SET" or "CHARSET", ex: utf-8, utf-16, ascii,
binary, etc.
Unicode = "One Code"
"Interoperability of Different Computers and Software"
character set - the set of characters that is available that you can use
for different languages, for example utf-8
In Summary:
To store anything in a computer, you must first encode it,
i.e. convert it to bytes.
For example:
If you want to store music, you must first encode it using MP3, WAV, etc.
If you want to store a picture, you must first encode it using PNG, JPEG, etc.
If you want to store text, you must first encode it using ASCII, UTF-8, etc.
*** Demo Using Python's encode() and decode() function
Mystery Fun Fact !!!
byte string sample (encode):
b'\xff\xfeP\x00l\x00e\x00a\x00s\x00e\x00 \x00C\x00o\x00n\x00s\x00i\x00d\x00e\x00r\x00 \x00S\x00u\x00b\x00s\x00c\x00r\x00i\x00b\x00i\x00n\x00g\x00 \x00t\x00o\x00 \x00t\x00h\x00e\x00 \x00F\x00l\x00a\x00s\x00k\x00 \x00C\x00h\x00a\x00n\x00n\x00e\x00l\x00!\x00'
What the heck does this mean? (use utf-16 and decode !!!)
🙏 Please consider SUBSCRIBING !!! 🧧 Patreon Donations: / theflask
DISCLAIMER:
All product and company names are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.
Use of MySQL Conditional Use Logos:
https://bit.ly/3iwhu4I