cpp-terminal
1.0.0
Small C++ library for writing multiplatform terminal applications
Loading...
Searching...
No Matches
unicode.hpp
Go to the documentation of this file.
1
2
/*
3
* cpp-terminal
4
* C++ library for writing multi-platform terminal applications.
5
*
6
* SPDX-FileCopyrightText: 2019-2024 cpp-terminal
7
*
8
* SPDX-License-Identifier: MIT
9
*/
10
11
#pragma once
12
13
#include <string>
14
15
namespace
Term
16
{
17
namespace
Private
18
{
19
20
// utf16 is useless and wstring too so utf16 inside wstring is useless^2 but windows use it so define this functions to deal with it and less the user forget it.
21
#if defined(_WIN32)
22
std::string
to_narrow
(
const
std::wstring& wstr);
23
std::wstring
to_wide
(
const
std::string& str);
24
#endif
25
34
std::string
utf32_to_utf8
(
const
char32_t
& codepoint,
const
bool
& exception =
false
);
35
44
std::string
utf32_to_utf8
(
const
std::u32string& str,
const
bool
& exception =
false
);
45
46
}
// namespace Private
47
}
// namespace Term
Term::Private::to_wide
std::wstring to_wide(const std::string &str)
Definition
unicode.cpp:40
Term::Private::utf32_to_utf8
std::string utf32_to_utf8(const char32_t &codepoint, const bool &exception=false)
Encode a codepoint using UTF-8 std::string .
Definition
unicode.cpp:55
Term::Private::to_narrow
std::string to_narrow(const std::wstring &wstr)
Definition
unicode.cpp:26
Term
Definition
args.cpp:13
cpp-terminal
private
unicode.hpp
Generated by
1.11.0