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

Unicode and regexs etc #168

Open
gtoal opened this issue Jan 3, 2024 · 1 comment
Open

Unicode and regexs etc #168

gtoal opened this issue Jan 3, 2024 · 1 comment

Comments

@gtoal
Copy link

gtoal commented Jan 3, 2024

You mentioned "mpc Only supports ASCII. Sorry! Writing a parser library that supports Unicode is pretty difficult. I welcome contributions!". I have a parser at https://github.com/gtoal/uparse which works entirely in Unicode - I modified a regex package to work in 32-bit code points rather than 8-bit ascii characters. I don't expect you'll be able to take anything from that parser directly but maybe reading through it you'll get some hints how to update your own code to handle Unicode. Basically it boils down to reading UTF8 on input and writing UTF8 on output, but doing all operations within the code using a 32-bit object rather than a char, which it turns out isn't really all that difficult once you get started.

Best regards,
Graham Toal

@orangeduck
Copy link
Owner

Thanks Graham I will take a look.

@HalosGhost HalosGhost mentioned this issue Aug 13, 2024
Closed
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

2 participants