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

Wrong unicode is used for special characters with UPPERCASE/lowercase plugins #1126

Closed
mesqueeb opened this issue Apr 11, 2020 · 7 comments
Closed
Labels

Comments

@mesqueeb
Copy link

I write this with my keyboard:

À

then I write this, and I convert it uppercase of PopClip:

à

it becomes

À

now I copy past both and log the charCode in JS:

'À'.charCodeAt(0) // 192
'À'.charCodeAt(0) // 65

Github comments seem to normalise this so I can't properly paste the difference...

but the top one is written with my keyboard, and the bottom one with popclip's uppercase conversion:

image

@mesqueeb
Copy link
Author

mesqueeb commented Apr 11, 2020

followup:
you can see in VSCode it's not recognised to be the same string any more... (look closely at the highlighting)

2020-04-11 10 05 21

@mesqueeb
Copy link
Author

Ok it's about this:

  • "NFC"
    Canonical Decomposition, followed by Canonical Composition.
  • "NFD"
    Canonical Decomposition.

there is no right or wrong answer...

@pilotmoon pilotmoon added the bug label Apr 26, 2021
@pilotmoon
Copy link
Owner

@mesqueeb
Copy link
Author

@invariant FYI, I think it makes most sense that you keep the original status of special characters:

  • ① special characters that are using "canonical decomposition" (under the hood 2 characters)
    • should be made capital / lower case by using the "canonical decomposition" version of its capital / lower case version.
  • ② special characters that are using "canonical composition" (under the hood 1 character)
    • should be made capital / lower case by using the "canonical composition" version of its capital / lower case version.

@pilotmoon
Copy link
Owner

Just going through some issues. I wonder, did this get resolved with the shift to JavaScript?

@mesqueeb
Copy link
Author

@pilotmoon I just double checked and it seems to be fixed! 🎉

NFD keeps NFD no matter how many times we convert,
and same for NFC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants