grep not returning text known to be in file

🫧 Open on Bubbles Symptom cat displays text, but grep can't find it: % cat foo.txt The world is overcome--aye! even here! By such as fix their faith on Unity. % grep fix foo.txt % Cause The file is UTF-16, not UTF-8/ASCII. For example, in UTF-16LE, fix is encoded as: 66 00 69 00 78 00 not as the contiguous ASCII bytes, which are also the UTF-8 bytes for fix : 66 69 78 So grep fix does not match. cat may still look readable because NUL bytes are often not visibly rendered. Detect encoding % file foo.txt foo.

添加评论
点赞收藏
点踩分享查看原文
评论
?
参与讨论