I wonder if there's something can be done with the Chilkat string libraries.
https://www.chilkatsoft.com/refdoc/xCkStringRef.html