Invalid pattern exception shows garbled characters instead of non-ASCII UTF-8 characters |
||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36 Steps to reproduce the problem: 1. Go to - data:text/html;charset=utf-8,<!doctype html><form><input required pattern="+[%D7%90-%D7%AA]"><input type=submit> 2. Open the Developer Tools. 3. Enter a non Hebrew letter. 4. Submit the form. 5. Look at the console. What is the expected behavior? Pattern attribute value +[א-ת] is not a valid regular expression: Uncaught SyntaxError: Invalid regular expression: /+[א-ת]/: Nothing to repeat What went wrong? Pattern attribute value +[×-ת] is not a valid regular expression: Uncaught SyntaxError: Invalid regular expression: /+[×-ת]/: Nothing to repeat Did this work before? N/A Does this work in other browsers? N/A Chrome version: 60.0.3112.113 Channel: stable OS Version: 6.1 (Windows 7, Windows Server 2008 R2) Flash Version:
,
Sep 1 2017
Probably unrelated to the Developer Tools, but maybe.
The message that the Developer Tools backend sends -
VM443:1 {"method":"Log.entryAdded","params":{"entry":{"source":"rendering","level":"error","text":"Pattern attribute value +\u00EF\u00BF\u00BD is not a valid regular expression: Uncaught SyntaxError: Invalid regular expression: /+\u00EF\u00BF\u00BD/: Nothing to repeat","timestamp":1504291126687.89,"url":"data:text/html;charset=utf-8,\u003C!doctype html\u003E\u003Cform\u003E\u003Cinput required pattern=\"+%00\"\u003E\u003Cinput type=submit\u003E"}}}
So it is surely not a front-end problem.
,
Sep 1 2017
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/html/forms/BaseTextInputType.cpp?sq=package:chromium&dr=CSs&l=94 I guess it is not really UTF-8 at that point.
,
Sep 2 2017
It is utf, but strings in Blink are utf16, so String::Format is misused.
,
Sep 4 2017
I found String::format() supported only LChar. We can't use non-Latin1 characters at all.
,
Sep 19 2017
,
Sep 19 2017
,
Sep 20 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/16998683979b56208252c259ea550ad4c82af935 commit 16998683979b56208252c259ea550ad4c82af935 Author: Shanmuga Pandi M <shanmuga.m@samsung.com> Date: Wed Sep 20 06:47:38 2017 Avoid the usage of String::Format for non-ASCII UTF-8 characters. String::Format is supported only LChar. So we cant use non-Latin1 characters at all and usage of this showing garbled characters instead of non-ASCII UTF-8 characters. Bug: 761466 Change-Id: Ie113b537227b79a59c3a9b96e85d1aaad62d5d29 Reviewed-on: https://chromium-review.googlesource.com/672243 Reviewed-by: Kent Tamura <tkent@chromium.org> Commit-Queue: Shanmuga Pandi <shanmuga.m@samsung.com> Cr-Commit-Position: refs/heads/master@{#503074} [modify] https://crrev.com/16998683979b56208252c259ea550ad4c82af935/third_party/WebKit/Source/core/html/forms/BaseTextInputType.cpp [modify] https://crrev.com/16998683979b56208252c259ea550ad4c82af935/third_party/WebKit/Source/platform/wtf/text/WTFString.h
,
Sep 20 2017
,
Sep 20 2017
|
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by phistuck@gmail.com
, Sep 1 2017