utf8cpp
brew install utf8cpp
v4.1.1
BSL-1.0
Header-only C++ library for UTF-8 encoding/decoding with STL-compatible iterators, C++98 portable.
Why you might care
Provides lightweight, standard-compliant Unicode handling for C++ projects without external dependencies. Essential for C++ codebases that need UTF-8 validation, character iteration, and encoding conversion while maintaining compatibility with older C++ standards. Used across commercial and open-source projects since 2006.
7.1k
30-day installs · #457
17.9k
90-day · #568
71.8k
365-day · #535
2.0k
★ GitHub stars · updated 1mo ago
Build dependencies
GitHub topics
cpp
cpp98
header-only
internationalization
portable
text
unicode
utf-16
utf-8
Links
- https://github.com/nemtrif/utfcpp
- GitHub: nemtrif/utfcpp
- Brew formula source: Formula/u/utf8cpp.rb
Blurb generated by claude-haiku-4-5 on today.
Raw metadata
{
"aliases": [],
"alternatives": [
"ICU",
"Boost.Locale",
"libunistring"
],
"build_dependencies": [
"cmake"
],
"categories": [
"header-only-library",
"library",
"text-processor"
],
"caveats": null,
"conflicts_with": [],
"dependencies": [],
"deprecated": 0,
"deprecation_reason": null,
"desc": "UTF-8 with C++ in a Portable Way",
"disable_reason": null,
"disabled": 0,
"enrichment_fetched_at": "2026-06-20T23:40:53+00:00",
"first_seen": "2026-06-20T23:34:18+00:00",
"full_name": "utf8cpp",
"github_default_branch": "master",
"github_last_commit_at": "2026-05-20T22:18:34Z",
"github_readme_excerpt": "\n\u003c!-- TOC --\u003e\u003ca name=\"utf8-cpp-utf-8-with-c-in-a-portable-way\"\u003e\u003c/a\u003e\n# UTF8-CPP: UTF-8 with C++ in a Portable Way\n\n\n\u003c!-- TOC --\u003e\u003ca name=\"introduction\"\u003e\u003c/a\u003e\n## Introduction\n\nC++ developers still miss an easy and portable way of handling Unicode encoded strings. The original C++ standard (known as C++98 or C++03) is Unicode agnostic. Some progress has been made in the later editions of the standard, but it is still hard to work with Unicode using only the standard facilities.\n\nI came up with a small, C++98 compatible generic library in order to handle UTF-8 encoded strings. For anybody used to work with STL algorithms and iterators, it should be easy and natural to use. The code is freely available for any purpose - check out the [license](./LICENSE). The library has been used a lot since the first release in 2006 both in commercial and open-source projects and proved to be stable and useful.\n\n## Table of Contents\n\n- [UTF8-CPP: UTF-8 with C++ in a Portable Way](#utf8-cpp-utf-8-with-c-in-a-portable-way)\n * [Introduction](#introduction)\n * [Installation](#installation)\n * [Examples of use](#examples-of-use)\n + [Introductory Sample](#introductory-sample)\n + [Checking if a file contains valid UTF-8 text](#checking-if-a-file-contains-valid-utf-8-text)\n + [Ensure that a string contains valid UTF-8 text](#ensure-that-a-string-contains-valid-utf-8-text)\n * [Points of interest](#points-of-interest)\n * [Reference](API_REFERENCE.md)\n\n## Reference\n\nFull API documentation is available in [`API_REFERENCE.md`](API_REFERENCE.md).\n\n\u003c!-- TOC --\u003e\u003ca name=\"installation\"\u003e\u003c/a\u003e\n## Installation\n\nThis is a header-only library and the supported way of deploying it is:\n- Download a release from https://github.com/nemtrif/utfcpp/releases into a temporary directory\n- Unzip the release\n- Copy the content of utfcpp/source file into the directory where you keep include files for your project\n\n\nThe CMakeList.txt file was originally made for testing purposes only, but unfortunately over ti",
"github_repo": "nemtrif/utfcpp",
"github_stars": 1962,
"github_topics": [
"cpp",
"cpp98",
"header-only",
"internationalization",
"portable",
"text",
"unicode",
"utf-16",
"utf-8"
],
"homepage": "https://github.com/nemtrif/utfcpp",
"homepage_og_description": null,
"homepage_og_image": null,
"homepage_title": null,
"installs_30d": 7126,
"installs_365d": 71782,
"installs_90d": 17891,
"keg_only": 0,
"keg_only_reason": null,
"last_seen": "2026-06-20T23:34:18+00:00",
"license": "BSL-1.0",
"llm_generated_at": "2026-06-20T23:45:00+00:00",
"llm_model": "claude-haiku-4-5",
"name": "utf8cpp",
"oldnames": [],
"one_liner": "Header-only C++ library for UTF-8 encoding/decoding with STL-compatible iterators, C++98 portable.",
"optional_dependencies": [],
"rank_30d": 457,
"rank_365d": 535,
"rank_90d": 568,
"raw_hash": "dc67279826f5bbe6",
"recommended_dependencies": [],
"revision": 0,
"ruby_source_path": "Formula/u/utf8cpp.rb",
"tap": "homebrew/core",
"test_dependencies": [
"cmake"
],
"uses_from_macos": [],
"version_head": null,
"version_stable": "4.1.1",
"versioned_formulae": [],
"why_use_this": "Provides lightweight, standard-compliant Unicode handling for C++ projects without external dependencies. Essential for C++ codebases that need UTF-8 validation, character iteration, and encoding conversion while maintaining compatibility with older C++ standards. Used across commercial and open-source projects since 2006."
}