We have users in several countries, some of whom expect usernames to support characters in their language (for example
Modern server-side databases can easily store such characters, but the Basic Auth implementation that Collect currently uses is technically limited to ASCII characters only.
Trying to use non-ASCII UTF-8 characters in either the username/password (under Collect's General Settings > Server) results in undefined behavior on some servers and errors on others.
the Rails gem Authlogic Collect's OkHttp sends data encoded as Latin-1, resulting in the server interpreting
caf� if the expected headers are missing.
Collect could implement RFC 7617 for Basic HTTP auth -- see nice explanation here.
TL;DR: Sending data as UTF-8 in certain circumstances could allow servers to process non-ASCII characters properly and understand them.
Seems a simple change, and we'd be willing to help contribute if this seems feasible.
This seems like a place to start digging; I'm not yet sure where exactly we'd need to make the change:
# src/test/java/org/odk/collect/android/openrosa/OpenRosaServerClientProviderTest.java assertThat(request.getHeader("Authorization"), equalTo("Basic dXNlcjpwYXNz"));