Does anyone know which character encoding is used in
.netrc? As a German user, I sometimes put umlauts in passwords.
So my question is, are these treated as latin1 or may I assume that I am doing fine encoding the file in UTF-8?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
There's no applicable standard for
.netrc, which started off in the 1980s as a BSD feature. That of course predates UTF-8. However, since there are no standards, you may be using someone's "improvement" which assumes (a) locale-based encoding or (b) UTF-8. Don't count on it.
The password used for ftp is covered by an RFC (again, predating UTF-8), and says the content is ASCII. In section 5.3.2, the relevant part of the BNF is
<password> ::= <string> <string> ::= <char> | <char><string> <char> ::= any of the 128 ASCII characters except <CR> and <LF>
The later RFCs build on RFC 959, but don't change the rules. However, implementers stretch things, so you're able to use Latin1.