When file is saved, 0x48 gets into the file. The editor holds the bytes in its buffer and pass it on to windowing system which decodes and displays the byte 0x48 as H. For example, when letter H is typed in a text editor, the OS encodes the keystroke as byte 0x48 and pass it to editor. Similar process plays out when we create a text file. Suppose we capture a video in mpeg format, the encoder in the camera encodes the pixels into bytes and when played back, the decoder coverts back the bytes to pixels. Encode and Decodeīefore diving into Unicode, first let’s understand terms - encode and decode. In this post, we try to demystify Unicode with easy to grasp examples. Many tutorials and posts about character encoding are heavy in theory with little real examples. However, when we crisscross byte and char streams, things can get confusing unless we know the charset basics. Normally we don’t pay much attention to character encoding in Java.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |