PAC-E014 · non-ascii-characters

Non-ASCII characters in code

high · Errors and robustness

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 checker

Good

function FindProxyForURL(url, host) {
  if (dnsDomainIs(host, ".corp.example")) {
    return "DIRECT";
  }
  return "PROXY proxy.corp.example:8080";
}
Open good example in checker

Engine behaviour

EngineBehaviourSource
chromiumA 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

Source: code = read in the engine's source, doc = vendor documentation, lab = observed in a lab run, expert = practitioner knowledge, not yet verified.

Related rules

References