{"id":17321380,"url":"https://github.com/m13253/libwintf8","last_synced_at":"2025-04-14T15:40:47.662Z","repository":{"id":22679372,"uuid":"26022967","full_name":"m13253/libWinTF8","owner":"m13253","description":"The library handling things related to UTF-8 and Unicode when you want to port your program to Windows","archived":false,"fork":false,"pushed_at":"2017-01-13T06:02:32.000Z","size":145,"stargazers_count":16,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T04:34:52.879Z","etag":null,"topics":["unicode","utf-8","windows"],"latest_commit_sha":null,"homepage":null,"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/m13253.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-31T16:03:31.000Z","updated_at":"2024-10-25T15:50:52.000Z","dependencies_parsed_at":"2022-08-05T18:30:09.597Z","dependency_job_id":null,"html_url":"https://github.com/m13253/libWinTF8","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m13253%2FlibWinTF8","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m13253%2FlibWinTF8/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m13253%2FlibWinTF8/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m13253%2FlibWinTF8/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m13253","download_url":"https://codeload.github.com/m13253/libWinTF8/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248907844,"owners_count":21181411,"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":["unicode","utf-8","windows"],"created_at":"2024-10-15T13:36:59.863Z","updated_at":"2025-04-14T15:40:47.635Z","avatar_url":"https://github.com/m13253.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"libWinTF8\n=========\n\nLibWinTF8 is the library handling things related to UTF-8 and Unicode when you want to port your program to Windows.\n\n## Compiling\n\nYou need a C++ 11 compliant compiler (GCC / Clang) or MSVC (at least version 12, that is Visual Studio 2013) and CMake to build this library.\n\nOn POSIX compatible systems with GCC toolchain, run `./configure \u0026\u0026 make` to build it.\n\nOn Windows with MSVC toolchain, generate a Visual Studio solution from `CMakeLists.txt` and build it.\n\nConsidering the C++ ABI compatibility issue, it is recommended to use the same compiler to build libWinTF8 as well as other parts of your software.\n\n## Usage\n\nUpon successful installation, you will be able to access all the functionality with C or C++ by including `libwintf8.h`\n\nEvery C++ function is under the `WTF8` namespace.\n\nEvery C function is prefixed with `WTF8_`.\n\n## Demo\n\nThe following is a simple `cat` program, supporting UTF-8 filename and Unicode output.\n\n```c++\n#include \u003ciostream\u003e\n#include \u003cvector\u003e\n#include \u003clibwintf8.h\u003e\n\n/* Set the Windows console font to Lucida Console, which is the only console font supporting Unicode characters. */\nstatic WTF8::SetConsoleFont set_console_font;\n\nint main() {\n    /* WTF8::u8string inherits std::string. In addition to useful conversion methods, introducing a new type makes sure that different encodings do not mix up. */\n    std::vector\u003cWTF8::u8string\u003e argv = WTF8::getargv();\n    if(argv.size() \u003c 2) {\n        WTF8::cerr \u003c\u003c \"Usage: \" \u003c\u003c argv[0] \u003c\u003c \" filename\" \u003c\u003c std::endl;\n        return 1;\n    }\n\n    /* WTF8::ifstream / ofstream / fstream accept WTF8::u8string as file name. */\n    WTF8::u8string filename = argv[1];\n    WTF8::ifstream fileobj(filename);\n    if(!fileobj.is_open()) {\n        WTF8::cerr \u003c\u003c \"Error: unable to open file '\" \u003c\u003c filename \u003c\u003c \"'\" \u003c\u003c std::endl;\n        return 2;\n    }\n\n    /* WTF8::cin / cout / cerr / clog use UTF-8 text. */\n    char c;\n    while(fileobj.get(c))\n        WTF8::cout \u003c\u003c c;\n    return 0;\n}\n```\n\n## Documentation\n\nThis project is in early development and the documentation is not finished yet. If you enjoy libWinTF8, consider helping me to document it.\n\nAlternatively you can browse and read the source code to understand how it works.\n\n## License\n\nThis software is licensed under BSD license. Refer to the [COPYING](COPYING) file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm13253%2Flibwintf8","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm13253%2Flibwintf8","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm13253%2Flibwintf8/lists"}