Not sure if this is the right RFC but based on https://www.rfc-editor.org/rfc/rfc3986.html:
From 3.4. Query query = *( pchar / "/" / "?" )
From 3.3 pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
Note that "@" is explicitly call out as not encoded.
Edit: Github is currently down but I am using https://github.com/1184893257/okhttp/blob/master/okhttp/src/main/java/com/squareup/okhttp/HttpUrl.java to encode the URL. If you think their encoding is wrong please open a ticket with them.