We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Thanks for this library. I am building a typing speed training game for Zhuyin (注音) input and this will be convenient.
The tone marks from Zhuyin input are incorrectly having a length of 2 when they should be 1.
const eaw = require("eastasianwidth") eaw.characterLength("ˋ") // 2 eaw.characterLength("ˇ") // 2 eaw.characterLength("˙") // 2 eaw.characterLength("ˊ") // 2
The text was updated successfully, but these errors were encountered:
Using icu4j, all these characters are ambiguous, so 2 is correct.
System.out.println(UCharacter.getIntPropertyValue('ˋ', UProperty.EAST_ASIAN_WIDTH)); // UCharacter.EastAsianWidth.AMBIGUOUS; System.out.println(UCharacter.getIntPropertyValue('ˇ', UProperty.EAST_ASIAN_WIDTH)); // UCharacter.EastAsianWidth.AMBIGUOUS; System.out.println(UCharacter.getIntPropertyValue('˙', UProperty.EAST_ASIAN_WIDTH)); // UCharacter.EastAsianWidth.AMBIGUOUS; System.out.println(UCharacter.getIntPropertyValue('ˊ', UProperty.EAST_ASIAN_WIDTH)); // UCharacter.EastAsianWidth.AMBIGUOUS;
If you want 1, you can use eastAsianWidth to determine if 'A' is 1. Sample implementation: power-assert-util-string-width
eastAsianWidth
Sorry, something went wrong.
ambiguousIsNarrow
No branches or pull requests
Thanks for this library. I am building a typing speed training game for Zhuyin (注音) input and this will be convenient.
The tone marks from Zhuyin input are incorrectly having a length of 2 when they should be 1.
The text was updated successfully, but these errors were encountered: