{"id":26664177,"url":"https://github.com/b1tflyyyy/utf8-string-cpp","last_synced_at":"2025-04-11T20:08:26.092Z","repository":{"id":228564286,"uuid":"773783093","full_name":"b1tflyyyy/utf8-string-cpp","owner":"b1tflyyyy","description":"Implementation of wrapper over standard string to work with UTF-8 encoding ","archived":false,"fork":false,"pushed_at":"2024-03-25T18:24:18.000Z","size":1019,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-03-25T21:27:01.957Z","etag":null,"topics":["cmake","cpp","cpp20","cross-platform","encoding","library","linux","mit","mit-license","string","unicode","utf-8","windows"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/b1tflyyyy.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-03-18T11:48:03.000Z","updated_at":"2024-03-25T21:27:01.958Z","dependencies_parsed_at":"2024-03-23T21:26:35.875Z","dependency_job_id":null,"html_url":"https://github.com/b1tflyyyy/utf8-string-cpp","commit_stats":null,"previous_names":["b1tflyyyy/utf8-string-cpp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b1tflyyyy%2Futf8-string-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b1tflyyyy%2Futf8-string-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b1tflyyyy%2Futf8-string-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b1tflyyyy%2Futf8-string-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/b1tflyyyy","download_url":"https://codeload.github.com/b1tflyyyy/utf8-string-cpp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245495809,"owners_count":20624806,"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":["cmake","cpp","cpp20","cross-platform","encoding","library","linux","mit","mit-license","string","unicode","utf-8","windows"],"created_at":"2025-03-25T15:56:44.538Z","updated_at":"2025-03-25T15:56:45.077Z","avatar_url":"https://github.com/b1tflyyyy.png","language":"C++","readme":"## ⚙️ UTF-8 String For C++ (utf8::ustring)\n\n## 📜 Brief Description:\nThis is an implementation of the `UTF-8` encoding standard for `C++`, the implementation is based on the `std::basic_string\u003cchar\u003e` class, this gives us the advantage of `std::basic_string\u003cchar\u003e` class functions, as well as compatibility with some functions from the standard library.\n\n## 📝 Code Style:\n- `C++ AStyle` code style was used for this project.\n\n## 🛠 Technical Dependencies:\n- `C++ 20`\n- `CMake 3.14`\n\n## 🔗 Support Status On Systems:\n- [X] Linux (verified on clang)\n- [X] Windows (verified on gcc \u0026\u0026 clang)\n\n## 💫 Library Features:\n- Support for creating an object from: `std::string, std::string_view, const char*`\n- Comparing an `utf8::ustring` with `utf8::ustring`, `const char*`, `std::string`, `std::string_view`\n- Copy/Move (\u003c- assignment also) constructor implemented \n- O(1) Random Access\n- Simple replacement of any character, e.g. a smaller character `(1 byte)` with a larger character `(2-3-4 bytes)`.\n- Write/read to a file\n\n## ⚡️ Performance Test:\n| String-Version |        Test-Name        | iteration count | time (for all iterations) | \n|:--------------:|:-----------------------:|:---------------:|:-------------------------:|\n|  std::string   |      replace_char       |     500'000     |          ~0.57s           |                          \n| utf8::ustring  |      replace_char       |     500'000     |          ~0.60s           |\n\n## ❔ Replace Char O(1) ?\nYes and no, in the case where we replace a character with another `with the same size`, we have `O(1)`, in the other case we have `O(~N)`, where N is the length of the string.\nBut in any case we have `O(1) Random Access`.\n\n## 📚 Code Samples:\n```cpp\nstd::string str{ \"hello world!\" };\nutf8::ustring ustr{ str };\n\nustr.replace_char(\"п\", 0); // \"пello world!\"\n\nustr == \"hi !\"; // false\nustr == str; // false\n```\n\n## ⭐️ Coming Soon:\n- Docs.\n\n### © 2024 Andrii (AKA b1tflyyyy). All rights reserved.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb1tflyyyy%2Futf8-string-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fb1tflyyyy%2Futf8-string-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb1tflyyyy%2Futf8-string-cpp/lists"}