Bug 180105 - jsc binary operates on UTF-8-encoded bytes rather than actual source text
Summary: jsc binary operates on UTF-8-encoded bytes rather than actual source text
Status: RESOLVED DUPLICATE of bug 180205
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 180205
Blocks:
  Show dependency treegraph
 
Reported: 2017-11-28 13:39 PST by Mathias Bynens
Modified: 2017-12-01 12:55 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mathias Bynens 2017-11-28 13:39:37 PST
There is a difference between input entered directly into the jsc REPL (through a terminal set to UTF-8) vs. passed as a file (saved with UTF-8 encoding).

    $ jsc -e 'print("\xCF\x80" === "π")'
    false

    $ jsc
    >>> print("\xCF\x80" === "π")
    true

This might lead people to (incorrectly!) believe that e.g. jsc’s implementation of Unicode property escapes is broken:

    $ jsc
    >>> /\p{Script=Greek}/u.test("π")
    false

    $ jsc -e 'print(/\p{Script=Greek}/u.test("π"))'
    true
Comment 1 Mathias Bynens 2017-12-01 11:45:09 PST
https://bugs.webkit.org/show_bug.cgi?id=180105
Comment 2 Mathias Bynens 2017-12-01 11:45:31 PST
Fixed in 180205.
Comment 3 Alexey Proskuryakov 2017-12-01 12:55:41 PST

*** This bug has been marked as a duplicate of bug 180205 ***