Results 1 to 3 of 3

Thread: text formatting problem

  1. #1
    Join Date
    Mar 2015
    Indianapolis area

    Default text formatting problem

    I have a file that "file -b" identifies as:Little-endian UTF-16 Unicode text, with CRLF, CR line terminatorsIf I 'cat' the file, it looks fine. Here is an example line:Edition: EnterpriseIf I use 'less' to view the same file, I get this: (same line)^@E^@d^@i^@t^@i^@o^@n^@:^@ ^@E^@n^@t^@e^@r^@p^@r^@i^@s^@e^@^M^@I don't see this problem on my CentOS computers, only OpenSuse.

  2. #2
    Join Date
    Aug 2010
    Chicago suburbs
    Blog Entries

    Default Re: text formatting problem

    I'm not clear what is the problem.

    The file contains 16 bit characters. And "less" is looking at it as a file of 8-bit characters. So it is seen 8 zero-bits between each char. It shows the 8 zero bits as "^@".
    openSUSE Leap 15.1; KDE Plasma 5;
    testing Leap 15.2Alpha

  3. #3
    Join Date
    Jun 2008

    Default Re: text formatting problem

    If you want to see what is exactly in the file, use
    od -x
    Then you switch off the trials to decode the bytes into characters.

    And please in the future use CODE tags around copied/pasted computer text in a post. It is the # button in the tool bar of the post editor. When applicable copy/paste complete, that is including the prompt, the command, the output and the next prompt.
    Specialy in a case like this it is important for others to see what is your explaining text and what is what you see that the computer showing. Now that is rather unclear.
    Henk van Velden

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts