unable to cat log file of type "UTF-8 Unicode (with BOM) text, with no line terminators"
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
unable to cat log file of type "UTF-8 Unicode (with BOM) text, with no line terminators"
Hi all ,
I have some application logs of this type "UTF-8 Unicode (with BOM) text, with no line terminators". I am unable to cat or view it. when i do a vi on it..i get some strange chars.
I have some application logs of this type "UTF-8 Unicode (with BOM) text, with no line terminators". I am unable to cat or view it. when i do a vi on it..i get some strange chars.
This file seems a bit odd. U+FEFF is the BOM. This is unnecessary (and not recommended) in UTF8. Also the two-byte encoding is UTF-16! And why are there so many — there should only be one BOM at the beginning. The answer to that is probably that it's been used as a zero-width non-breaking space, which is allowed but strongly deprecated.
Try using iconv to switch UFT16 to UTF8 and see if the result is readable.
[root@hst]# hexdump -C aplg.log
00000000 ef bb bf ef bb bf ef bb bf ef bb bf ef bb bf ef |................|
00000010 bb bf ef bb bf ef bb bf ef bb bf ef bb bf ef bb |................|
00000020 bf ef bb bf ef bb bf ef bb bf ef bb bf ef bb bf |................|
00000030 ef bb bf ef bb bf ef bb bf ef bb bf ef bb bf ef |................|
00000040 bb bf ef bb bf ef bb bf ef bb bf ef bb bf ef bb |................|
00000050 bf ef bb bf ef bb bf ef bb bf ef bb bf ef bb bf |................|
00000060 ef bb bf ef bb bf ef bb bf ef bb bf ef bb bf ef |................|
00000070 bb bf ef bb bf ef bb bf ef bb bf ef bb bf ef bb |................|
00000080 bf ef bb bf ef bb bf ef bb bf ef bb bf ef bb bf |................|
00000090 ef bb bf ef bb bf ef bb bf ef bb bf ef bb bf ef |................|
000000a0 bb bf ef bb bf ef bb bf ef bb bf ef bb bf ef bb |................|
000000b0 bf ef bb bf ef bb bf ef bb bf ef bb bf ef bb bf |................|
000000c0 ef bb bf ef bb bf ef bb bf ef bb bf ef bb bf ef |................|
000000d0 bb bf ef bb bf ef bb bf ef bb bf ef bb bf ef bb |................|
000000e0 bf ef bb bf ef bb bf ef bb bf ef bb bf ef bb bf |................|
000000f0 ef bb bf ef bb bf ef bb bf ef bb bf ef bb bf ef |................|
00000100 bb bf ef bb bf ef bb bf ef bb bf ef bb bf ef bb |................|
00000110 bf ef bb bf ef bb bf ef bb bf ef bb bf ef bb bf |................|
00000120 ef bb bf ef bb bf ef bb bf ef bb bf ef bb bf ef |................|
00000130 bb bf ef bb bf ef bb bf ef bb bf ef bb bf ef bb |................|
00000140 bf ef bb bf ef bb bf ef bb bf ef bb bf ef bb bf |................|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.