Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 788 Bytes

README.md

File metadata and controls

24 lines (18 loc) · 788 Bytes

utf8_string_view

A string_view addressed to UTF-8 encoded characters.

Common string view not treat UTF-8 encoding at this way we take incorrect string length (based on code units) and iterate by bytes (code units).

This utf8_string_view type can treat UTF-8 enconding and take correct length (based on code points) and iterate by character (code points).

One byte character:   a
Two byte character:   ç
Three byte character: ⊞
Four byte character:  🠶

Common string view:
Length: 6		 Data: 1🠶3
Each character iteration (foreach): 	1 � � � � 3
Each character iteration (for index): 	1 � � � � 3

UTF-8 string view:
Length: 3		 Data: 1🠶3
Each character iteration (foreach): 	1 🠶 3
Each character iteration (for index): 	1 🠶 3