Menu

1 / 2

UTF-8 Encoding in Rust

DEV Community·Riettah·6 months ago
#zr3kymLe
#rust#rustlanguage#api#computerscience#byte
Reading 0:00
15s threshold

We’ll discover the powerful synergy between one of the most popular programming languages together. But today, our attention lays on the versatile UTF-8 character encoding system.

UTF-8 is a variable-length encoding for Unicode. Vague explanation, i knoww! Here, I’ll do a not so deepdeep explanation on what UTF-8 means, just enough to make you have an idea of what it means.

UNICODE TRANSFORMATION FORMAT — 8-BIT, UTF-8.

In Rust, UTF-8 means that all string types (String and &str) are guaranteed to be encoded using valid UTF-8 sequences, this translates Unicode characters into a variable length sequence of 1 to 4 bytes, allowing it to represent practically in every character, in any language ( i.e Chinese, Latin) and emoticons.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.