{"id":13730270,"url":"https://github.com/IMQS/utfz","last_synced_at":"2025-05-08T02:32:07.134Z","repository":{"id":64005007,"uuid":"65883744","full_name":"IMQS/utfz","owner":"IMQS","description":"Tiny C++ UTF-8 library - safe, no exceptions","archived":false,"fork":false,"pushed_at":"2022-06-11T08:26:29.000Z","size":24,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":30,"default_branch":"master","last_synced_at":"2024-11-14T21:37:53.616Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IMQS.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-17T06:58:30.000Z","updated_at":"2022-06-10T07:58:32.000Z","dependencies_parsed_at":"2023-01-14T18:30:19.218Z","dependency_job_id":null,"html_url":"https://github.com/IMQS/utfz","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IMQS%2Futfz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IMQS%2Futfz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IMQS%2Futfz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IMQS%2Futfz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IMQS","download_url":"https://codeload.github.com/IMQS/utfz/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252986904,"owners_count":21836252,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T02:01:12.547Z","updated_at":"2025-05-08T02:32:06.866Z","avatar_url":"https://github.com/IMQS.png","language":"C++","readme":"# utfz - a tiny C++ library for parsing and encoding utf-8\n\nThe goal of this library is to provide a tiny set of utilities that make it easy\nto iterate over the code points of a UTF8 string, as well as build up a UTF8 string\nfrom 32-bit integer code points.\n\n- Header-only (utfz.hpp), or two source files (utfz.cpp and utfz.h)\n- Does not throw exceptions\n- 100% line coverage in tests\n- All iteration methods support both null terminated strings, and explicit length strings\n- Checks for all invalid code points (overlong sequences, UTF-16 surrogate pairs, 0xFFFE, 0xFFFF)\n- Returns the replacement character U+FFFD for any invalid sequences, and continues parsing on the next plausible code point\n\nExample of printing code points to the console:\n\n```cpp\nconst char* a_utf8_string;\nfor (int cp : utfz::cp(a_utf8_string))\n    printf(\"%d \", cp);\n```\n\nExample of `tolower` using `std::string`:\n\n```cpp\nstd::string input;\nstd::string low;\nfor (int cp : utfz::cp(input))\n    utfz::encode(low, ::tolower(cp));\n// 'low' now contains the lower-case representation of 'input'\n```\n\nIterating manually, over a null terminated string:\n\n```cpp\nconst char* pos = input; // input is const char*\nint cp;\nwhile (utfz::next(pos, cp))\n\tprintf(\"%d \", cp);\n```\n\nIterating manually, over a string with known length:\n\n```cpp\nconst char* pos = input;       // input is const char*\nconst char* end = input + len;\nint cp;\nwhile (utfz::next(pos, end, cp))\n\tprintf(\"%d \", cp);\n```\n","funding_links":[],"categories":["C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIMQS%2Futfz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FIMQS%2Futfz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIMQS%2Futfz/lists"}