Code Monkey home page Code Monkey logo

libunicode's Introduction

C++20 CI Build

Modern C++20 Unicode Library

The goal of this library is to bring painless unicode support to C++ with simple and easy to understand APIs.

The API naming conventions are chosen to look familiar to those using the C++ standard libary.

Feature Overview

  • API for accessing UCD properties
  • UTF8 <-> UTF32 conversion
  • wcwidth equivalent (int unicode::width(char32_t))
  • grapheme segmentation (UTS algorithm)
  • symbol/emoji segmentation (UTS algorithm)
  • script segmentation UTS 24
  • unit tests for most parts (wcwidth / segmentation)
  • generic text run segmentation (top level segmentation API suitable for text shaping implementations)
  • word segmentation (UTS algorithm)
  • CLI tool: uc-inspect for inspecting input files by code point properties, grapheme cluster, word, script, ...

Unicode Technical Specifications

  • UTS 11 - character width
  • UTS 24 - script property
  • UTS 29 - text segmentation (grapheme cluster, word boundary)
  • UTS 51 - Emoji

Integrate with your CMake project

git submodule add --name libunicode https://github.com/contour-terminal/libunicode 3rdparty/libunicode
add_subdirectory(3rdparty/libunicode)

add_executable(your_tool your_tool.cpp)
target_link_libraries(your_tool PRIVATE unicode::unicode)

Contributing

Users of this library

Disclaimer

This library is -in terms of features- by no means competive to the ICU library, but it attempts to provide a clean and intuitive modern C++ API for those that do not want to fight legacy-style C APIs.

I hope that over time we can add more and more features to this library to conform to the Unicode specification eventually at some point and I welcome everyone to contribute to it by forking the library, creating pull requests, or even just constructive feedback.

License

libunicode - a modern C++20 unicode library
-------------------------------------------

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.