วันพุธที่ 14 ธันวาคม พ.ศ. 2554

What to do when a text file seems unreadable

It's just a matter of convention between the world of Windows and UNIX compatible operating systems, but is sufficient to generate files (partially) illegible. Here's how to prevent.

What to do when a text file seems unreadable

If you need to work or study at the turn of the Windows world and the UNIX-derived operating systems, you will surely happen to come across in text files fully functional until they are managed by Linux, the various free-net -OpenBSD, Mac OS, etc., but become useless when opened with Windows Notepad

The problem

As can be seen carefully observing the contents of the file, the text is more or less intact: to be completely stoned are the line breaks, ie those symbols that mark the individual lines.

The problem is caused by the fact that the delimiters used in Windows are different from those used by the UNIX family: while Microsoft platforms using the combination CR + LF (better known as r n , from the equivalent abstraction offered by the C programming language), the UNIX world using only the control character LF ( n in C): so here explained why, when the Windows Notepad encounters this sequence can not interpret it correctly.

How to fix it

The best way to solve this problem is to leave the notebook and rely on a more powerful editor. The choice is really wide: personally, I particularly like Notepad + +.

The following image, you can see how the line breaks are interpreted correctly by the program and the same file that was unreadable is now displayed correctly

Note also how the program is labeled UNIX in the second half of the right of the status bar, just to indicate that the encoding of the current document is different from that used by Windows.

By accessing the Format menu also, there are a number of items Convert for precisely adapted to the current document's encoding of a particular architecture.

See Pictures and Read more : What to do when a text file seems unreadable

ไม่มีความคิดเห็น:

แสดงความคิดเห็น