Bug 180753
Summary: | makeString: add single-character helpers | ||
---|---|---|---|
Product: | WebKit | Reporter: | JF Bastien <jfbastien> |
Component: | Web Template Framework | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | achristensen, cturner, darin, Hironori.Fujii, jfbastien, sam |
Priority: | P2 | ||
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
See Also: |
https://bugs.webkit.org/show_bug.cgi?id=193101 https://bugs.webkit.org/show_bug.cgi?id=165924 |
||
Bug Depends on: | 180720 | ||
Bug Blocks: |
JF Bastien
It's neat how we do RawPointer(...) when trying to print (so we don't inadvertently pass a pointer). We should do the same thing for raw characters, especially considering that right now `unsigned short` just prints as a character (see test I added in #180720)!
While we're there, it would also be very neat to have makeString helpers for integer formatting such as HexInt(...) while also choosing upper-/lower-case and 0x prefix. The same can be done for left-padding (with spaces or arbitrary character) as well as alignment, etc.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
JF Bastien
Note that we already have FormattedNumber for floating-point values.
Darin Adler
All good ideas. But please only add things we use.
Charlie Turner
I attempted the syntax for raw characters in https://bugs.webkit.org/show_bug.cgi?id=193101
Fujii Hironori
ICU 59 did the gutsy API breaking change typedefing UChar as char16_t.
http://site.icu-project.org/download/59
What about the idea updating WTF's copy of ICU header?
This seems a right direction?
Darin Adler
(In reply to Fujii Hironori from comment #4)
> ICU 59 did the gutsy API breaking change typedefing UChar as char16_t.
> http://site.icu-project.org/download/59
> What about the idea updating WTF's copy of ICU header?
> This seems a right direction?
Yes, I think that would be a good way to end up.
I think this would be a significant transition project for WebKit. On Cocoa platforms, the types for Unicode characters in Core Foundation and Foundation, UniChar and unichar, are both typedefs for unsigned short. Thus there are many places where we use UChar, UniChar, and unichar interchangeably. Most of those would need to change.
I think we've been careful to only use the C functions in ICU with C linkage, so we wouldn't have the most obvious kinds of runtime incompatibility issues, like mangled function names being different.