Howto find which files are in PC and which ones are in MAC ?

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
wsl
Posts: 5
Joined: Wed May 21, 2014 8:55 am

Howto find which files are in PC and which ones are in MAC ?

Post by wsl »

Using TextPad, is there some way to find which files are in PC and which ones are in MAC ?

Thank you.

Roger
I hope General is ok as
I did not know where to post this question...
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Are you referring to line endings (PC: CR,LF, Mac: CR)?

If so, look at the document properties:
View | Document Properties or <Alt+Enter>
It's on the Document tab at Line ending.

Or enter <Ctrl+F1> and look at the the left-hand end of the status bar.

PC means CR,LF
Unix means LF
Mac means CR.
User avatar
AmigoJack
Posts: 531
Joined: Sun Oct 30, 2016 4:28 pm
Location: グリーン ヒル ゾーン
Contact:

Post by AmigoJack »

Or do you have a batch of files in which you want to find one of the specific endings?
wsl
Posts: 5
Joined: Wed May 21, 2014 8:55 am

Where are the parameters/properties hinding in the file ?

Post by wsl »

ben_josephs
AmigoJack

Sirs,

I am looking at a batch of 151 files.

I see what Ctrl-F1 tells me.

I also know how to look at the properties function ( Alt-Enter ) of each of the files ; but, being lazy, I thought perhaps some code should be visible in the file.

Where is the data ( visible with Alt-Enter and Ctrl-F1 ) hiding ?

Where are the parameters hinding in the file ?

Thank you.
User avatar
AmigoJack
Posts: 531
Joined: Sun Oct 30, 2016 4:28 pm
Location: グリーン ヒル ゾーン
Contact:

Post by AmigoJack »

The "code" is "visible" if you'd look at your file in binary. To find all files for one of the line ending modes search all files (CTRL+F5), tick the condition "Regular expression" and:
  1. find [^\x0a]\x0d[^\x0a] to list all files having only CR linebreaks (Mac)
  2. find [^\x0d]\x0a[^\x0d] to list all files having only LF linebreaks (Unix)
  3. find \x0d\x0a to list all files having CRLF linebreaks (Windows)
Of course, files having not even one line break are found in none of these.
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

There are no parameters. The line endings are just characters in the file.

If you highlight whole lines you will see that the highlight extends to the right of the text of each line. Unix (including Mac OS X/macOS) uses LF line endings and old Macs used CR line endings; both these single-character line endings show as a single highlighted space. Windows uses CR,LF line endings; these double-character line endings show as two highlighted spaces. The difference is easier to see if you select View | Visible Spaces.

And if you search for \n (generic newline) (with Regular expression selected) the text found will be one character wide for LF or CR, two characters wide for CR,LF.
wsl
Posts: 5
Joined: Wed May 21, 2014 8:55 am

Howto find which files are in PC and which ones are in MAC

Post by wsl »

Thank you very much.
I found the two files.



Please take a look at

Image
Image


Perhaps I could have found them by looking at
the result in the website also ;
but now I learned something with TextPad.

Regards
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

The difference between those two files is in their encoding, not the operating system under which they were produced (or their line endings).

In the upper example the character encoding of the page is different from the encoding assumed by the browser. Perhaps the file in the upper example is ISO-8859-1 (or Windows-1252) and the file in the lower one is UTF-8.

Examine the files in binary and look for the encoding of, say, é. If it's encoded as (hex) E9, it's ISO-8859-1 (or Windows-1252). If it's encoded as C3 A9 it's UTF-8.
wsl
Posts: 5
Joined: Wed May 21, 2014 8:55 am

Post by wsl »

ben_josephs, Thank you for your comment.

If you'd looked at the original http://rene.pommier.free.fr/Decence.htm
you would say differently.

I have simply recorded the HTML code from the « faulty » file
Code : ANSI
File type : MAC : Image
into a different one:
Code : UTTF-8
File type : PC
see :Image


Thank you all.

p.s.
How can I mark this thread as resolved ?
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

That confirms what I wrote: the upper file is encoded in ISO-8859-1 ("ANSI"), the lower one in UTF-8. The line ending ("type de fichier") is not the issue.
User avatar
AmigoJack
Posts: 531
Joined: Sun Oct 30, 2016 4:28 pm
Location: グリーン ヒル ゾーン
Contact:

Post by AmigoJack »

wsl wrote:this thread
phpBB doesn't know threads either, only topics.

I'm afraid fundamental understandings about line endings and encodings is still not clear to you. Not to speak of that you came in the with a question that has nothing to do with what is discussed now.

In TextPad use the menu item "Save as..." and then pay attention to the combobox "Encoding" - select "UTF-8" there and preferably tick the checkbox "UNICODE BOM" too to make your HTML document being interpreted correctly. Unrelated to on which operating system you edited it.
wsl
Posts: 5
Joined: Wed May 21, 2014 8:55 am

How to find which files are in PC and which ones are in MAC

Post by wsl »

Thank you AmigoJack for correctly answering my question
"How to find which files are in PC and which ones are in MAC ?"
It helped me find the wrongly coded pages
Regards,
Post Reply