Skip to content

Commit

Permalink
Fix parsing unicode codepoints
Browse files Browse the repository at this point in the history
It was using the wrong variable (the version not being trimmed) so it was miscounting characters.
  • Loading branch information
ThioJoe committed Sep 9, 2024
1 parent c30f1fa commit 8cf00d8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ private string ParseEachPossibleCodepoint(string[] codePoints)
}

// If any are 4 characters, add a leading zero to make all a consistant 5 characters
if (codePoint.Length == 4)
if (sanitizedCodepoint.Length == 4)
{
sanitizedCodepoint = "0" + sanitizedCodepoint;
}
Expand Down Expand Up @@ -982,7 +982,7 @@ private void buttonCustomInfo_Click(object sender, EventArgs e)
"For Unicode:\n" +
" This should be a 4 or 5 character codepoint. If sending\n" +
" a glyph that uses a zero-width joiner like some emojis,\n" +
" all codepoints must be 5 characters.\n\n" +
" all codepoints must be 5 characters or split by spaces or U+.\n\n" +

"-------------------- Examples --------------------\n\n" +

Expand All @@ -999,7 +999,7 @@ private void buttonCustomInfo_Click(object sender, EventArgs e)
"Unicode Zero-Width-Joiner Valid Examples:\n" +
" 1F468 0200D 1F33E (Split by spaces)\n" +
" 1F4680200D1F33E (Combined but all are 5 characters)\n" +
" U+1F468 U+0200D U+1F33E (Split by U+)"
" U+2764 U+FE0F U+200D U+1F525 (Split by U+)"
,
"Custom Key Code Info",
MessageBoxButtons.OK,
Expand Down

0 comments on commit 8cf00d8

Please sign in to comment.