init:初版
This commit is contained in:
commit
a581dee39b
17
.clang-format
Normal file
17
.clang-format
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
BasedOnStyle: LLVM
|
||||||
|
IndentWidth: 4
|
||||||
|
PointerAlignment: Left
|
||||||
|
AccessModifierOffset: -4
|
||||||
|
BreakBeforeBraces: Custom
|
||||||
|
BraceWrapping:
|
||||||
|
AfterFunction: true
|
||||||
|
AfterClass: true
|
||||||
|
Cpp11BracedListStyle: true
|
||||||
|
ReflowComments: true
|
||||||
|
SpacesBeforeTrailingComments: 3
|
||||||
|
TabWidth: 4
|
||||||
|
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
||||||
|
ColumnLimit: 80
|
||||||
|
AllowShortBlocksOnASingleLine: Never
|
||||||
|
AllowShortFunctionsOnASingleLine: None
|
||||||
|
AllowShortEnumsOnASingleLine: false
|
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
build
|
||||||
|
.vs
|
||||||
|
.cache
|
||||||
|
cmake-*
|
82
.vscode/settings.json
vendored
Normal file
82
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
{
|
||||||
|
"files.autoSave": "onFocusChange",
|
||||||
|
"editor.fontSize": 14,
|
||||||
|
"editor.fontFamily": "'Source Code Pro', 'Source Code Pro', monospace",
|
||||||
|
"terminal.integrated.fontFamily": "Source Code Pro",
|
||||||
|
"cmake.configureOnOpen": true,
|
||||||
|
"cmake.debugConfig": {
|
||||||
|
"console": "integratedTerminal",
|
||||||
|
"setupCommands": [
|
||||||
|
{
|
||||||
|
"description": "-gdb-set charset utf-8",
|
||||||
|
"text": "-gdb-set charset UTF-8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Enable gdb pretty-printing",
|
||||||
|
"text": "-enable-pretty-printing",
|
||||||
|
"ignoreFailures": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"args": [
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"cmake.configureSettings": {
|
||||||
|
//"CMAKE_TOOLCHAIN_FILE": "${env:VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
|
||||||
|
},
|
||||||
|
"cmake.options.statusBarVisibility": "visible",
|
||||||
|
"cmake.generator": "Ninja",
|
||||||
|
"C_Cpp.default.compileCommands": "${workspaceRoot}/build/compile_commands.json",
|
||||||
|
"C_Cpp.default.cppStandard": "c++17",
|
||||||
|
"editor.inlayHints.enabled": "off",
|
||||||
|
"editor.unicodeHighlight.allowedLocales": {
|
||||||
|
"ja": true,
|
||||||
|
"zh-hant": true,
|
||||||
|
"zh-hans": true
|
||||||
|
},
|
||||||
|
"files.associations": {
|
||||||
|
"atomic": "cpp",
|
||||||
|
"cctype": "cpp",
|
||||||
|
"clocale": "cpp",
|
||||||
|
"cmath": "cpp",
|
||||||
|
"cstddef": "cpp",
|
||||||
|
"cstdint": "cpp",
|
||||||
|
"cstdio": "cpp",
|
||||||
|
"cstdlib": "cpp",
|
||||||
|
"cstring": "cpp",
|
||||||
|
"ctime": "cpp",
|
||||||
|
"cwchar": "cpp",
|
||||||
|
"exception": "cpp",
|
||||||
|
"initializer_list": "cpp",
|
||||||
|
"ios": "cpp",
|
||||||
|
"iosfwd": "cpp",
|
||||||
|
"iostream": "cpp",
|
||||||
|
"istream": "cpp",
|
||||||
|
"iterator": "cpp",
|
||||||
|
"limits": "cpp",
|
||||||
|
"memory": "cpp",
|
||||||
|
"new": "cpp",
|
||||||
|
"ostream": "cpp",
|
||||||
|
"stdexcept": "cpp",
|
||||||
|
"streambuf": "cpp",
|
||||||
|
"string": "cpp",
|
||||||
|
"system_error": "cpp",
|
||||||
|
"tuple": "cpp",
|
||||||
|
"type_traits": "cpp",
|
||||||
|
"typeinfo": "cpp",
|
||||||
|
"utility": "cpp",
|
||||||
|
"xfacet": "cpp",
|
||||||
|
"xiosbase": "cpp",
|
||||||
|
"xlocale": "cpp",
|
||||||
|
"xlocinfo": "cpp",
|
||||||
|
"xlocnum": "cpp",
|
||||||
|
"xmemory": "cpp",
|
||||||
|
"xmemory0": "cpp",
|
||||||
|
"xstddef": "cpp",
|
||||||
|
"xstring": "cpp",
|
||||||
|
"xtr1common": "cpp",
|
||||||
|
"xutility": "cpp",
|
||||||
|
"bit": "cpp",
|
||||||
|
"compare": "cpp",
|
||||||
|
"concepts": "cpp"
|
||||||
|
}
|
||||||
|
}
|
14
CMakeLists.txt
Normal file
14
CMakeLists.txt
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
|
project(winu8test LANGUAGES CXX)
|
||||||
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
|
if (MSVC)
|
||||||
|
add_compile_options(/utf-8)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
message(STATUS "System: ${CMAKE_SYSTEM_NAME}")
|
||||||
|
message(STATUS "Compiler CXX ID: ${CMAKE_CXX_COMPILER_ID}")
|
||||||
|
|
||||||
|
add_executable(winu8test main.cpp)
|
12
README.md
Normal file
12
README.md
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# win下u8测试
|
||||||
|
|
||||||
|
| Terminal emulator | 状态 |
|
||||||
|
| ----------------- | ---- |
|
||||||
|
|cmd|不支持。|
|
||||||
|
|powershell|不支持。|
|
||||||
|
| [https://github.com/wez/wezterm](https://github.com/wez/wezterm) | 支持,但粘贴的显示不对(仅显示)。在早些版本`版本 10.0.17763.316`测试OK。 |
|
||||||
|
|[https://github.com/alacritty/alacritty](https://github.com/alacritty/alacritty)| 在早些版本上,不支持。在`Version 10.0.19045.2846`上测试支持。|
|
||||||
|
|[https://github.com/Maximus5/ConEmu](https://github.com/Maximus5/ConEmu)|不支持。|
|
||||||
|
|[https://github.com/cmderdev/cmder/](https://github.com/cmderdev/cmder/)|不支持。|
|
||||||
|
|[https://github.com/microsoft/terminal](https://github.com/microsoft/terminal)|在早些版本上,无法启动。在`Version 10.0.19045.2846`上测试支持。|
|
||||||
|
|
15
main.cpp
Normal file
15
main.cpp
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <windows.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
SetConsoleOutputCP(CP_UTF8);
|
||||||
|
SetConsoleCP(CP_UTF8);
|
||||||
|
std::string tp;
|
||||||
|
std::cout << "u8 read output test!" << std::endl;
|
||||||
|
std::cout << "あああ🙂🙂🙂👌中文👍Кириллица" << std::endl;
|
||||||
|
std::getline(std::cin, tp);
|
||||||
|
std::cout << tp << std::endl;
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user