cutf-7

The symbols in the C source code file are automatically replaced after I save(maybe)


When I opened the file in my editor, I found that # had been replaced with +ACM-, < with +ADw-, > with +AD4-, and "\n with +ACIAXA-n. I searched some keywords on the search engine, but got no results, so I came here for help.

This problem came up when I was writing a program that was generated from multiple source files, including one .h file and two .c files. I remember when I referenced a function defined in one of the files and the compiler showed me (or "prompted") something containing "ACM,ADs" and I wondered what that was.

I tried to search for +ACM- and +ACM- on a search engine, to no avail. I tried changing the encoding format of the file and nothing changed. <--Add after the fact--> This problem occurs when using Embarcad Dev-C++, which supports UTF-7 encoding.


Solution

  • This is indeed UTF-7 encoding.

    E.g. +ACM- translates (by Base64) to the bit sequence:

      000000 000010 001100
    

    which comes from the following (with two 0's appended to get a multiple of 6 bits for the base64 encoding):

      0000 0000 0010 0011
    

    which again corresponds to U+0023, i.e. the character #.