diff --git a/core/meson.build b/core/meson.build index 62b3d0ee08..42b0965763 100644 --- a/core/meson.build +++ b/core/meson.build @@ -9,7 +9,7 @@ project('keyman_core', 'cpp', 'c', version: run_command(find_program('getversion.bat', 'getversion.sh'), check:true).stdout().strip(), license: 'MIT', default_options : ['buildtype=release', - 'cpp_std=c++14', + 'cpp_std=c++17', 'b_vscrt=static_from_buildtype', 'warning_level=2', 'debug=true'], diff --git a/core/src/km_core_state_api.cpp b/core/src/km_core_state_api.cpp index 16af9511d8..8165a85779 100644 --- a/core/src/km_core_state_api.cpp +++ b/core/src/km_core_state_api.cpp @@ -13,7 +13,6 @@ #include #include #include -#include #include "keyman_core.h" #include "jsonpp.hpp" @@ -22,6 +21,7 @@ #include "state.hpp" #include "vkey_to_contextreset.hpp" #include "kmx_file.h" +#include "utfcodec.hpp" using namespace km::core; @@ -357,7 +357,7 @@ km_core_cu * km_core_state_context_debug( km_core_context_items_dispose(context_items); - std::u16string s = std::wstring_convert, char16_t>{}.from_bytes(buffer.str()); + std::u16string s = convert(buffer.str()); km_core_cu* result = new km_core_cu[s.size() + 1]; s.copy(result, s.size()); diff --git a/core/src/kmx/kmx_xstring.cpp b/core/src/kmx/kmx_xstring.cpp index 382d091905..a1d5ff518a 100644 --- a/core/src/kmx/kmx_xstring.cpp +++ b/core/src/kmx/kmx_xstring.cpp @@ -4,7 +4,6 @@ */ #include #include -#include #include #include "kmx_processevent.h" #include "utfcodec.hpp" diff --git a/core/tests/unit/ldml/ldml_test_source.cpp b/core/tests/unit/ldml/ldml_test_source.cpp index 30e807e8bc..dc76b10d63 100644 --- a/core/tests/unit/ldml/ldml_test_source.cpp +++ b/core/tests/unit/ldml/ldml_test_source.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #if 0 // TODO-LDML If we need to avoid exceptions in JSON @@ -200,7 +199,7 @@ LdmlTestSource::parse_source_string(std::string const &s) { std::u16string LdmlTestSource::parse_u8_source_string(std::string const &u8s) { // convert from utf-8 to utf-16 first - std::u16string s = std::wstring_convert, char16_t>{}.from_bytes(u8s); + std::u16string s = convert(u8s); std::u16string t; for (auto p = s.begin(); p != s.end(); p++) { if (*p == '\\') { @@ -219,7 +218,7 @@ LdmlTestSource::parse_u8_source_string(std::string const &u8s) { size_t n; std::u16string s1 = s.substr(p - s.begin(), 8); // TODO-LDML: convert back first? - std::string s1b = std::wstring_convert, char16_t>{}.to_bytes(s1); + std::string s1b = convert(s1); v = std::stoul(s1b, &n, 16); // Allow deadkey_number (U+0001) characters and onward assert(v >= 0x0001 && v <= 0x10FFFF); diff --git a/docs/build/old/core-desktop-notes.md b/docs/build/old/core-desktop-notes.md index f4c4123104..6b8a9ccb37 100644 --- a/docs/build/old/core-desktop-notes.md +++ b/docs/build/old/core-desktop-notes.md @@ -6,7 +6,7 @@ WARNING: these are old configuration notes. See [index.md](../index.md) for curr - Python 3 - Meson build system 0.45+ (0.56+ for WASM) - ninja 1.8+ -- C++14 or later compiler (VC++ 2019 or later for Windows). +- C++17 or later compiler (VC++ 2019 or later for Windows). - lib std::fs - kmc (for tests) -- must be added to path