Skip to content

davidkennedydev/utf8_string_view

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A string_view addressed to UTF-8 encoded characters.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published