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

Work around WinCompose issue for U+Axxx or U+Exxx #18260

Merged
merged 2 commits into from
Sep 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 17 additions & 10 deletions quantum/unicode/unicode.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,19 +324,26 @@ void register_hex(uint16_t hex) {
}

void register_hex32(uint32_t hex) {
bool onzerostart = true;
bool first_digit = true;
bool needs_leading_zero = (unicode_config.input_mode == UC_WINC);
for (int i = 7; i >= 0; i--) {
if (i <= 3) {
onzerostart = false;
}
// Work out the digit we're going to transmit
uint8_t digit = ((hex >> (i * 4)) & 0xF);
if (digit == 0) {
if (!onzerostart) {
send_nibble_wrapper(digit);
}
} else {

// If we're still searching for the first digit, and found one
// that needs a leading zero sent out, send the zero.
if (first_digit && needs_leading_zero && digit > 9) {
send_nibble_wrapper(0);
}

// Always send digits (including zero) if we're down to the last
// two bytes of nibbles.
bool must_send = i < 4;

// If we've found a digit worth transmitting, do so.
if (digit != 0 || !first_digit || must_send) {
send_nibble_wrapper(digit);
onzerostart = false;
first_digit = false;
}
}
}
Expand Down