Skip to content

chore(common): replace codecvt in module u16 🐸 #12107

Merged
SabineSIL merged 5 commits intorefactor/core/make-utfcodec-commonfrom
chore/common/remove_codecvt
Aug 13, 2024
Merged

chore(common): replace codecvt in module u16 🐸 #12107
SabineSIL merged 5 commits intorefactor/core/make-utfcodec-commonfrom
chore/common/remove_codecvt

Conversation

@SabineSIL
Copy link
Copy Markdown
Contributor

std::codecvt will be deprecated by C++17.

We still use std::codecvt in module u16 in /developer/src/kmcmplib/src/

std::codecvt needs to be exchanged with "convert" from utfcodec.hpp

fixes #11922

@keymanapp-test-bot skip

@SabineSIL SabineSIL added this to the A18S8 milestone Aug 6, 2024
@SabineSIL SabineSIL self-assigned this Aug 6, 2024
@keymanapp-test-bot
Copy link
Copy Markdown

keymanapp-test-bot bot commented Aug 6, 2024

User Test Results

Test specification and instructions

User tests are not required

Test Artifacts

@SabineSIL SabineSIL requested a review from ermshiperete August 6, 2024 15:06
@github-actions github-actions bot added common/ and removed common/ labels Aug 6, 2024
@SabineSIL SabineSIL changed the title chore(common): replace codecvt in module u16 chore(common): replace codecvt in module u16 🐸 Aug 6, 2024
@github-actions github-actions bot added common/ and removed common/ labels Aug 7, 2024
@SabineSIL
Copy link
Copy Markdown
Contributor Author

In kmx_u16.cpp/ u16tof(): use strtof() inside of u16tof() since u16tof() gave interesting results (e.g. rounds where it should not)

@SabineSIL SabineSIL force-pushed the chore/common/remove_codecvt branch from a0ae35a to a3a7bd3 Compare August 13, 2024 13:10
@SabineSIL SabineSIL changed the base branch from master to refactor/core/make-utfcodec-common August 13, 2024 13:13
@github-actions github-actions bot added common/ and removed common/ labels Aug 13, 2024
/* Record a system store for the line number of the begin statement */
//wcscpy(tstr, DEBUGSTORE_MATCH);
u16sprintf(tstr, _countof(tstr), L"%ls%d ", u16fmt(DEBUGSTORE_MATCH).c_str(), (int) fk->currentGroup);
u16sprintf(tstr, _countof(tstr), L"%ls%d ", wstring_from_u16string(DEBUGSTORE_MATCH).c_str(), (int) fk->currentGroup);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
u16sprintf(tstr, _countof(tstr), L"%ls%d ", wstring_from_u16string(DEBUGSTORE_MATCH).c_str(), (int) fk->currentGroup);
u16sprintf(tstr, _countof(tstr), L"%ls%d ", DEBUGSTORE_MATCH_L, (int) fk->currentGroup);

and then define:

#define DEBUGSTORE_MATCH_U		u"M"
#define DEBUGSTORE_MATCH_L		L"M"

@github-actions github-actions bot added common/ and removed common/ labels Aug 13, 2024
@SabineSIL SabineSIL marked this pull request as ready for review August 13, 2024 14:02
@SabineSIL SabineSIL requested a review from darcywong00 as a code owner August 13, 2024 14:02
Copy link
Copy Markdown
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SabineSIL SabineSIL merged commit 777bf2e into refactor/core/make-utfcodec-common Aug 13, 2024
@SabineSIL SabineSIL deleted the chore/common/remove_codecvt branch August 13, 2024 19:18
mcdurdin added a commit that referenced this pull request Nov 6, 2024
Fixes a regression arising from #12107 in debug store strings.

Relates-to: #12623
Relates-to: #12107
mcdurdin added a commit that referenced this pull request Nov 7, 2024
…on-debug-store

fix(developer): use 'N' for nomatch store debug strings (regression in #12107)
ermshiperete added a commit that referenced this pull request Jul 17, 2025
codecvt is deprecated in C++ 17. See also #12107.

Test-bot: skip
ermshiperete added a commit that referenced this pull request Jul 18, 2025
codecvt is deprecated in C++ 17. See also #12107.

Test-bot: skip
ermshiperete added a commit that referenced this pull request Jul 18, 2025
cvosoft pushed a commit to cvosoft/keyman that referenced this pull request Oct 23, 2025
codecvt is deprecated in C++ 17. See also keymanapp#12107.

Test-bot: skip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(core): replace std::codecvt in module u16

3 participants