MicroTeX icon indicating copy to clipboard operation
MicroTeX copied to clipboard

Make a template version of the latex parser that doesn't use `wchar_t`

Open appetrosyan opened this issue 3 years ago • 2 comments

Hi. Most LaTeX is not possible to use as UTF-16, so the wchar_t support seems mostly to be needed for the internationalisation support, and not LaTeX.

As it stands, it may be worth exploring a code path that doesn't rely on wchar_t and instead directly uses UTF-8 strings. In my case, this would significantly reduce the memory footprint, (embedded systems need to be miserly with the RAM), so I was wondering if you'd accept a PR that did that?

appetrosyan avatar Jun 03 '21 07:06 appetrosyan

so I was wondering if you'd accept a PR that did that?

Yes, your PR is very welcome. I'm planning to replace the std::wstring with the plain old UTF-8 strings. Because the parser needs to iterate over the string to get the Unicode codepoint of the character, I've followed the most intuitive and easy way :sweat_smile: .

NanoMichael avatar Jun 03 '21 08:06 NanoMichael

There's no wchar_t anymore, please take a look at the branch openmath.

NanoMichael avatar Feb 14 '22 15:02 NanoMichael