0

I'm trying to convert UTF-8 characters from a file to NCR Hexadecimal. I tried the following:

iconv -f UTF-8 -t //TRANSLIT file --unicode-subst=&#x%04X;'

However, it doesn't do anything, and I can't even find the appropriate encoding name for NCR in iconv --list.

Samy
  • 629
  • 8
  • 22
  • 1
    Can you clarify what result you expect from "NCR"? – deceze Aug 20 '21 at 07:44
  • @deceze I expect UTF-8 characters to be converted to NCR HEX. For example, a space should translate to " ". – Samy Aug 20 '21 at 17:34
  • 1
    Anyway, this does not look like a job for `iconv`, you do not want to change encoding, only the way the information is presented. It looks like a job for C or python or other UTF-aware languages - read one codepoint, and output it with `$04X`. – KamilCuk Aug 20 '21 at 17:39
  • @KamilCuk I thought so. Thanks for your help! – Samy Aug 20 '21 at 17:57
  • You want *HTML entities*…‽ – deceze Aug 20 '21 at 18:27

0 Answers0