I have some strings that include encoding that would work with TeX, (For example they look like "Pi/~na Colada" instead of Piña Colada). Is there a simple way to convert this to show properly without creating my own function to convert the characters?
CodePudding user response:
No.
But:
- The tex.stackexchange.com wiki has a decent list of TeX accents.
- Then you just need to correlate them with their UTF-8 combining mark.
- Make sure you move the combining mark to after the character you want it combined with.
- eg:
"/~n"
to"n" . $combining_mark
- eg:
- You might then want to run it through intl's Normalizer in NFC form to compose the character into a single codepoint, if it exists.