Skip to content

Instantly share code, notes, and snippets.

@arodland
Last active July 25, 2017 04:10
Show Gist options
  • Save arodland/e69d417d7f6a3ae1a623d85c58c618c6 to your computer and use it in GitHub Desktop.
Save arodland/e69d417d7f6a3ae1a623d85c58c618c6 to your computer and use it in GitHub Desktop.
#if PERL_VERSION_GE(5,25,9)
#define foldit(p,e,s,l) toFOLD_utf8_safe(p,e,s,l)
#else
// toFOLD_utf8 only became a valid synonym during 5.19, but to_utf8_fold
// works from 5.8 through 5.24.
#define foldit(p,e,s,l) to_utf8_fold(p,s,l)
#endif
// called as
foldit(ptr, in + in_len, folded, &folded_len);
// where ptr is a pointer into 'in'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment