0

So I can install Ubuntu as a subsystem on Windows 10 and there is the location of all files. Everyone says "You can not edit files from windows gui".

I wonder exactly why?

Is it because windows use NTFS?

anything of these:?

Line breaks Windows uses CRLF (\r\n, 0D 0A) line endings while Unix just uses LF (\n, 0A).

Character Encoding Most modern (i.e., since 2004 or so) Unix-like systems make UTF-8 the default character encoding.

Windows, however, lacks native support for UTF-8. It internally works in UTF-16, and assumes that char-based strings are in a legacy code page. Fortunately, Notepad is capable of reading UTF-8 files; unfortunately, "ANSI" encoding is still the default.

Problematic Special Characters U+001A SUBSTITUTE Windows (rarely) uses Ctrl+Z as an end-of-file character. For example, if you type a file at the command prompt, it will be truncated at the first 1A byte.

On Unix, Ctrl+Z is nothing special.

U+FEFF ZERO WITH NO-BREAK SPACE (Byte-Order Mark) On Windows, UTF-8 files often start with a "byte order mark" EF BB BF to distinguish them from ANSI files.

On Linux, the BOM is discouraged because it breaks things like shebang lines in shell scripts. Plus, it'd be pointless to have a UTF-8 signature when UTF-8 is the default encoding anyway.

source: https://superuser.com/a/294280/517467

What are the options? Can I edit a file with some specific editor? Like Visual Studio Code?

1 Answers1

2

It's all of the problems you've mentioned above. The CR/LF discrepancy and such and the other incompatibilities create errors that are often very cryptic to diagnose

Many editors do have support for detecting the right type of newline character, and Visual Studio Code as mentioned by you also has a switch on the status bar to switch beetween the two

No one really says "You can not edit files from the windows gui", it's always that it's not recommended as if you don't know what you're doing, you could cause more trouble than it's owrth

Amith KK
  • 13,547