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.

New contributor
luca is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

luca is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.