Bicameral Engine
GPU-resident engine for a magic-research open-world game
Loading...
Searching...
No Matches
unicode.h
Go to the documentation of this file.
1// unicode.h — UTF-8(エンジンの中の文字列)と UTF-16(Windows の W 系 API)の変換。
2//
3// エンジンの中の文字列はすべて UTF-8 で持つ(MSVC は /utf-8 でビルドしている)。
4// OutputDebugStringW・FormatMessageW・ファイルパスなど、Windows と話す境界でだけ変換する。
5#pragma once
6
7#include <string>
8#include <string_view>
9
10namespace bicameral {
11
12 // UTF-16 → UTF-8。不正なサロゲートは U+FFFD に置き換わる
13 std::string ToUtf8(std::wstring_view text);
14
15 // UTF-8 → UTF-16。不正なバイト列は U+FFFD に置き換わる
16 std::wstring ToWide(std::string_view text);
17
18} // namespace bicameral
std::string ToUtf8(std::wstring_view text)
Definition unicode.cpp:10
std::wstring ToWide(std::string_view text)
Definition unicode.cpp:22