Git Product home page Git Product logo

utf8-utf16-converter's Introduction

UTF-16 <-> UTF-8 Converter

This project contains two small functions written in raw C (no C++ features) that can convert in-memory UTF-8 strings to UTF-16 and vice-versa.

It is written in standard C with no OS-specific functions and built & tested with CMake.

The converter folder contains a library with the conversion functions themselves. For more information on how to use the functions, consult the documentation comment above each function in its header (converter/include/converter.h).

The tester folder contains an executable that can be used to test the conversions, along with a suite of CTest test cases. For more information on how to use the tester program, consult the README.md in its folder.

Building

First, install CMake version 3.10 or higher and any required build tools for your platform (Visual Studio or Cygwin on Windows, gcc or clang on Linux, etc).

Then, just run (sh or cmd, one command per line):

Unix-like (gcc/clang/Cygwin)

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
ctest

Visual Studio

mkdir build
cd build
cmake ..
cmake --build . --config Release
ctest -C Release

This will build the project in a build directory, then run all tests with CTest. The cmake --build comamnd should tell you where to find the compiled libraries and executables.

For more information on how to customize the build process, check out CMake's documentation. This is a very simple project with no "magic" in the build process, so you shouldn't have trouble changing it to suit your needs.

Alternatively, you can just copy converter.h and converter.c into your project. The conversion functions are self-contained and use standard C functions and syntax.

utf8-utf16-converter's People

Contributors

davipb avatar itay2805 avatar

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.