
cgpsmapper allows you to enter those codes using a syntax ~[0x??] but that doesn't seem to work with mkgmap. If it did, the binary editor would not be needed.
What about \x04 (hex) or \4 (octal) or \u4 (hex, Unicode)? I have experienced that Java *.properties files allow the \u prefix for inputting Unicode code points. I don't know which method mkgmap uses for parsing the files. I'd vote for the \u syntax, as the files already are in Unicode (encoded to bytes in UTF-8).
\u Syntax is java Syntax, and is *NOT* UTF8-Encoding! Both of them are unicode, but the encoding scheme is different. At the moment it works fine, if you use an editor, which can handle unicode properly. But it is good idea, instead of introducing a new proprietary ~[xx] style, use a n existing standard, as e.g. the \u4 notation.