inukshuk/latex-decode — pull request #3 by cpence (2012-01-30 19:12:28+00:00)
Title: Support the Java native normalizer

The Unicode gem compiles on JRuby as a C extension, which is bad for performance (and won't run, for example, on Travis-CI). Detect when we're running under JRuby and switch to using Java's native Normalizer. Also, Java's normalizer does not normalize a floating orphan diacritic tilde into a proper tilde (nor, I think, should it). Support `\textasciitilde` instead.

Mostly, I'm interested in this because I want my app (which uses BibTeX-Ruby) to be able to do CI on Travis under JRuby. But more broadly, supporting the native normalizer is a Good Thing.

I'm not sure what you think should be done about the `\textasciitilde` issue. It's not surprising to me that some Unicode parsers would choke on a single combining tilde. Does TeX correctly format `\~{}`? If so, it's going to be hard to support generally, given the way you're handling diacritics -- maybe it should be handled somewhere other than the diacritic code?

In any event, I'd love to get this support into LaTeX-decode to get my builds back working on Travis under JRuby. Let me know if you'd like another approach in the patch, and I'd be glad to do that instead.