Convert src/charset.c to ANSI-style functions.