Skip to content

cse-summer-series/utf-8-introduction-AlanDeLuna18

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Review Assignment Due Date Open in Codespaces

Introduction to UTF-8

The starter code is a cleaned up version from the videos:

The task for this week is to fill in the function bytes_for(char* unicode, unsigned int n).

That function should take a UTF-8 string and a character count, and return the number of bytes in that UTF-8 string taken up by the first n characters.

Examples:

bytes_for("José", 3) -> 3
bytes_for("Ülo", 3) -> 4
bytes_for("José", 4) -> 5
bytes_for("成龙", 1) -> 3
bytes_for("成龙", 2) -> 6
bytes_for("成龙", 3) -> -1

Feel free to share questions and comments about this on the Discord!

Avoid posting full solutions just to make sure folks can figure it out on their own if they want. Do feel free to show posts with incomplete code or code with errors/surprising behavior, though!

About

ucsd-cse-summer-series-2024-utf-8-introduction-week2 created by GitHub Classroom

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 100.0%