Showing posts with label code. Show all posts
Showing posts with label code. Show all posts

Monday, May 6, 2024

System Text Encoding class decode UTF 16

 When to use UTF-16 or UTF-8

  1. What is UTF-16?:

  2. Code Units and Code Points:

  3. Example:

    • Let’s consider the letter “A” and the emoji “😂”:

      • The letter “A” has a Unicode code point of U+0041. In UTF-16, it is represented as 0041.

      • The emoji “😂” has a more complex code point (outside the BMP). Its Unicode code point is U+1F602. In UTF-16, it is represented as D83D DE42 2.

    • So, in summary:

      • “A” → UTF-16 representation: 0041

      • “😂” → UTF-16 representation: D83D DE42

Remember that UTF-16 provides a flexible way to handle characters from various languages and symbols, ensuring compatibility across different systems and applications!