If I open a binary file in vim it shows the following text:
ð<9F><92>¦. Encoding is set to UTF-8. But when I search for its content with
strings --encoding=S myfile I see the 💦 emoji. As far as I understand the encoding setting for strings should also be UTF-8 (The strings manpage says
S = single-8-bit-byte characters
). I now need to edit that file to contain a different emoji, but it still needs to be in that same format as in the beginning. So I guess it would be the best to convert the file, edit, and convert back but I've had no success with
iconv -f ISO-8859-1 -t UTF-8 myfile. I took the settings for iconv from this webpage that told me the
ð <9F> <92> ¦ form was
UTF-8 bytes as Latin-1 characters bytes.
And inbefore asks if I have emojis setup the right way in my terminal: I can display them, edit them in vim, etc. but only with the output of the strings command. So that should not be the problem. Thanks for your time.