Skip to content

Padding malfunction for full-width characters #19

@windymelt

Description

@windymelt

Hi, I suggest some improvement for this great library.

In East Asian languages, including Japanese, characters are represented with a width twice that of ASCII. This is expressed as full width in Unicode.

This library seems to calculate the amount of padding simply by character count, so if input that includes full-width characters is given, the table display will be corrupted.

Since there are libraries that determine whether Unicode characters are full-width or not[1], it would be possible to render the table accurately by improving the algorithm that calculates the amount of padding.

Actual output:

image

Thanks!

[1] https://unicode-org.github.io/icu-docs/apidoc/dev/icu4j/com/ibm/icu/lang/UCharacter.html#getIntPropertyValue-int-int-

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions