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

utf8proc_charwidth returns 1 for é character #170

Closed
markand opened this issue Jan 27, 2020 · 2 comments
Closed

utf8proc_charwidth returns 1 for é character #170

markand opened this issue Jan 27, 2020 · 2 comments

Comments

@markand
Copy link

markand commented Jan 27, 2020

Hi,

I'm sorry if I misunderstood the purpose of utf8proc_charwidth, I thought it'd return the number of bytes required for a given codepoint.

Example, the letter é in UTF-8 is two bytes long (value of 233 in unicode) but utf8proc_charwidth(233) always return 1.

Did I miss something or there is no function to get the number of bytes a codepoint require?

@PallHaraldsson
Copy link

I think you have this in mind:

julia> ncodeunits("é")
2

I think the other has to do with with on the screen, if I recall to support Chinese.

@stevengj
Copy link
Member

charwidth is an approximate on-screen width in fixed-width fonts, not the number of code units.

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

No branches or pull requests

3 participants