Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

SabineSIL
Copy link
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

keymanapp-test-bot bot commented Aug 6, 2024

User Test Results

Test specification and instructions

User tests are not required

Test Artifacts

@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
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 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
@@ -580,7 +580,7 @@ KMX_BOOL ParseLine(PFILE_KEYBOARD fk, PKMX_WCHAR str) {
//swprintf(tstr, "%d", fk->currentGroup);
/* 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
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
Copy link
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
6 checks passed
@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
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