Skip to content

provide get codepoint visual width function #107

@duarm

Description

@duarm

Unicode characters can have different visual widths, it would help if utf8.h had a builtin function to retrieve that.

A simple implementation can be found here. https://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c

simple usage of the above code with utf8.h

int codepoint;
void *v = utf8codepoint(text_ptr, &codepoint);
int w = mk_wcwidth((wchar_t)codepoint);

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