In bug 693624, zeniko points out that: > Adobe has actually managed to > specify password encodings in the PDF 1.7 ExtensionLevel 3 spec: For crypt > revisions 1 to 4, the password is in PdfDocEncoding (and not ISO-8859-1 as > your code handles it) likely with unsupported characters just dropped, and > for revisions 5 and 6 it's full UTF-8 (with prior SASLprep normalization and > then truncated to a maximum of 127 bytes). The handling for these cases > should then belong in pdf_crypt.c so that callers of > fz_authenticate_password don't have to do the conversion themselves. At the moment (or at least as soon as the commit in review now goes in) our command lines arrive at the processing phase in utf8. We convert these down to raw bytes (giving an error for any char outside the 0..255 range), and feed these into the authentication function. Arguably we should always pass passwords in utf8 encoded, and let the authentication routine convert as appropriate.
This was fixed in commit b302892a8c302aee9ca6d2abab2f32afbee3a8a5 Author: Tor Andersson <tor.andersson@artifex.com> Date: Mon Mar 4 13:56:54 2013 +0100 Convert UTF-8 passwords to correct encoding. PDFDocEncoding for crypt revisions <= 4, UTF-8 for newer.