Loading ...
Sorry, an error occurred while loading the content.

Unsafe characters

Expand Messages
  • Cory Bennett
    Hello, I got this error from jslint: Unsafe character. fn( FAILED— + message); The — is char 226 or 0xe2. It is not ascii, but I was wondering why it
    Message 1 of 2 , Apr 14 1:44 AM
    • 0 Attachment
      Hello,

      I got this error from jslint:
      Unsafe character.
      fn("FAILED—" + message);

      The '—' is char 226 or 0xe2. It is not ascii, but I was wondering why it
      mattered since it is in a quoted string. I didnt not see any reference
      to "Unsafe character" on the website.

      Thanks
      -Cory
    • Douglas Crockford
      ... why it ... There are characters that are handled inconsistently in the various implementations, and so must be escaped when placed in strings, and must
      Message 2 of 2 , Apr 14 10:39 AM
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, Cory Bennett <coryb@...> wrote:
        > I got this error from jslint:
        > Unsafe character.
        > fn("FAILEDâ€"" + message);
        >
        > The 'â€"' is char 226 or 0xe2. It is not ascii, but I was wondering
        why it
        > mattered since it is in a quoted string.

        There are characters that are handled inconsistently in the various
        implementations, and so must be escaped when placed in strings, and
        must never be used outside of strings:

        \u0000-\u001f
        \u007f-\u009f
        \u00ad
        \u0600-\u0604
        \u070f
        \u17b4
        \u17b5
        \u200c-\u200f
        \u2028-\u202f
        \u2060-\u206f
        \ufeff
        \ufff0-\uffff
      Your message has been successfully submitted and would be delivered to recipients shortly.