Non-ASCII characters in code
high
The file contains characters outside 7-bit ASCII in code position, typically smart quotes from a word processor or a stray emoji. Smart quotes are a syntax error; other characters are at best unnecessary.
Why it matters
Everything a PAC needs (hostnames, IP literals, proxy directives) is ASCII. Non-ASCII
characters appear through copy-paste from Word, Pages, mail clients or chat tools, which
replace " with U+201C/U+201D. Those are not string delimiters in JavaScript, so the file
does not parse and the client goes DIRECT. Characters inside comments are harmless to the
parser but indicate the same editing tool chain. Internationalised hostnames must be
written in their ASCII (punycode) form, which is also what the engine passes in host.
How to fix
Replace smart quotes with ASCII quotes, remove other non-ASCII characters; verify with `LC_ALL=C grep -nP '[^\x00-\x7F]' file`.
Examples
Bad
function FindProxyForURL(url, host) {
if (dnsDomainIs(host, “.corp.example”)) {
return “DIRECT”;
}
return "PROXY proxy.corp.example:8080";
}
Open bad example in checkerGood
function FindProxyForURL(url, host) {
if (dnsDomainIs(host, ".corp.example")) {
return "DIRECT";
}
return "PROXY proxy.corp.example:8080";
}
Open good example in checkerEngine behaviour
| Engine | Behaviour | Source |
|---|---|---|
| chromium | A non-ASCII string returned by FindProxyForURL is rejected as a script error ("returned a non-ASCII string"); non-ASCII inside string literals that are not returned is not an error. | code, verified 2026-10-04 · ref |
Related rules
- PAC file does not parse PAC-E001
- File starts with a UTF-8 byte order mark PAC-E013
- Zero-width or bidirectional control characters PAC-E015