Announcement

Collapse
No announcement yet.

Kate: how to view the newline encoding?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Kate: how to view the newline encoding?

    Kate has an option to change the end of line marks from UNIX to Windows or Mac, but how do you see the actual characters used for the end of line?

    If it's not possible with Kate, how can it be done?

    I'm curious about which type of newline encoding is used in a document I'm processing (it matters because I'd like to process it with perl)

    I've read that UNIX is \n, Windows is \r\n, but I don't know how to actually check it for myself!

    Thanks
    samhobbs.co.uk

    #2
    Geany will do this.
    Desktop PC: Intel Core-i5-4670 3.40Ghz, 16Gb Crucial ram, Asus H97-Plus MB, 128Gb Crucial SSD + 2Tb Seagate Barracuda 7200.14 HDD running Kubuntu 18.04 LTS and Kubuntu 14.04 LTS (on SSD).
    Laptop: HP EliteBook 8460p Core-i5-2540M, 4Gb ram, Transcend 120Gb SSD, currently running Deepin 15.8 and Manjaro KDE 18.

    Comment


      #3
      Thanks Rod,

      I just tried out Geany and it looks like it has a few nice features, but unfortunately it won't open my file - I get the error

      The file "/home/feathers-mcgraw/modsec_audit.log.example" does not look like a text file or the file encoding is not supported.
      When I open it in Kate I get this error:
      The file /home/feathers-mcgraw/modsec_audit.log.example was opened with UTF-8 encoding but contained invalid characters.
      It is set to read-only mode, as saving might destroy its content.
      This is probably because it's an Apache ModSecurity log file and contains quoted characters that were used in attempted SQL injection attacks etc (non - UTF-8) as well as the UTF-8 parts.

      samhobbs.co.uk

      Comment


        #4
        Originally posted by Feathers McGraw View Post
        I've read that UNIX is \n, Windows is \r\n, but I don't know how to actually check it for myself!
        Just quickly, on my phone, cat - v will tell you:

        cat - v file | more

        (That's an ASCII vertical bar, I'm not sure what Tapatalk will actually send.) Any \r characters will appear as ^M. (cos \r is ASCII 13, and M is the 13th letter, and you can type one by typing control-m.

        Regards, John Little
        Regards, John Little

        Comment

        Working...
        X