WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
ASSIGNED
187619
Add default implementation for formatLocalizedString()
https://bugs.webkit.org/show_bug.cgi?id=187619
Summary
Add default implementation for formatLocalizedString()
Basuke Suzuki
Reported
2018-07-12 14:48:11 PDT
Default implementation was notImplemented().
Attachments
PATCH
(1.63 KB, patch)
2018-07-12 14:54 PDT
,
Basuke Suzuki
Hironori.Fujii
: review-
ews-watchlist
: commit-queue-
Details
Formatted Diff
Diff
Archive of layout-test-results from ews201 for win-future
(12.91 MB, application/zip)
2018-07-12 19:54 PDT
,
EWS Watchlist
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Basuke Suzuki
Comment 1
2018-07-12 14:54:30 PDT
Created
attachment 344884
[details]
PATCH
EWS Watchlist
Comment 2
2018-07-12 19:54:13 PDT
Comment on
attachment 344884
[details]
PATCH
Attachment 344884
[details]
did not pass win-ews (win): Output:
https://webkit-queues.webkit.org/results/8522408
New failing tests: http/tests/security/canvas-remote-read-remote-video-blocked-no-crossorigin.html
EWS Watchlist
Comment 3
2018-07-12 19:54:25 PDT
Created
attachment 344918
[details]
Archive of layout-test-results from ews201 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews201 Port: win-future Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Fujii Hironori
Comment 4
2018-07-13 04:01:32 PDT
There is a comment in the file.
> // We can't use String::format for two reasons: > // 1) It doesn't handle non-ASCII characters in the format string. > // 2) It doesn't handle the %2$d syntax. > // Note that because |format| is used as the second parameter to va_start, it cannot be a reference > // type according to section 18.7/3 of the C++ N1905 standard.
If you implement this function by using vsnprintf, there is no reason not to use String::format which is also using vsnprintf. Note: There is a unresolved bug in String::format. (
Bug 186758
) I have a question. What will happen if String::format is given non-ASCII charactors?
Basuke Suzuki
Comment 5
2018-07-13 15:38:31 PDT
(In reply to Fujii Hironori from
comment #4
)
> There is a comment in the file. > > > // We can't use String::format for two reasons: > > // 1) It doesn't handle non-ASCII characters in the format string. > > // 2) It doesn't handle the %2$d syntax. > > // Note that because |format| is used as the second parameter to va_start, it cannot be a reference > > // type according to section 18.7/3 of the C++ N1905 standard. > > If you implement this function by using vsnprintf, there is no > reason not to use String::format which is also using vsnprintf.
Oh, that's right.
> I have a question. What will happen if String::format is given > non-ASCII charactors?
AFAIK, format string is okay with utf-8. An issue may happen when using string parameter with length like '%3s' format directive. I bet it won't truncate 'あいうえお' into 'あいう' but just 'あ' ( because it encoded int \xe3, \x81, \x82). Bigger issue, though, may be the lack of supporting '%2$d' syntax, parameter field
https://en.wikipedia.org/wiki/Printf_format_string#Parameter_field
This is very important for localization.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug