Rename wtf/unicode/UTF8.h
wtf/unicode/UTF8.h is conflicting with ICU header in MSVC builds. I'd like to rename wtf/unicode/UTF8.h to wtf/unicode/WTFUTF8.h. Any suggestion? Here is ICU's #include "unicode/utf8.h" which happens to include wtf/unicode/UTF8.h https://github.com/unicode-org/icu/blob/master/icu4c/source/common/unicode/u... Here is MSVC quoted form #include behavior documented. https://msdn.microsoft.com/en-us/library/36k2cdd4.aspx Bug 189693 – [Win][Clang] warning: #include resolved using non-portable Microsoft search rules as: ..\..\Source\WTF\wtf/unicode/utf8.h https://bugs.webkit.org/show_bug.cgi?id=189693 -- Fujii
Note that "WTF-8" is an encoding: https://simonsapin.github.io/wtf-8/ "WTFUTF8" might be ambiguous. On Wed, Oct 31, 2018 at 3:18 AM Fujii Hironori <fujii.hironori@gmail.com> wrote:
wtf/unicode/UTF8.h is conflicting with ICU header in MSVC builds. I'd like to rename wtf/unicode/UTF8.h to wtf/unicode/WTFUTF8.h. Any suggestion?
Here is ICU's #include "unicode/utf8.h" which happens to include wtf/unicode/UTF8.h
https://github.com/unicode-org/icu/blob/master/icu4c/source/common/unicode/u...
Here is MSVC quoted form #include behavior documented. https://msdn.microsoft.com/en-us/library/36k2cdd4.aspx
Bug 189693 – [Win][Clang] warning: #include resolved using non-portable Microsoft search rules as: ..\..\Source\WTF\wtf/unicode/utf8.h https://bugs.webkit.org/show_bug.cgi?id=189693
-- Fujii
_______________________________________________ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Oh no. I didn't know that. Thank you for letting me know. Then, how about <wtf/unicode/UTF-8.h>? There is <wtf/dtoa/double-conversion.h> which has '-' in the name.
31.10.2018, 05:18, "Fujii Hironori" <fujii.hironori@gmail.com>:
wtf/unicode/UTF8.h is conflicting with ICU header in MSVC builds. I'd like to rename wtf/unicode/UTF8.h to wtf/unicode/WTFUTF8.h. Any suggestion?
What about Unicode.h or UnicodeHelpers.h? UTF8.h deals with UTF16 as well
Here is ICU's #include "unicode/utf8.h" which happens to include wtf/unicode/UTF8.h https://github.com/unicode-org/icu/blob/master/icu4c/source/common/unicode/u...
Here is MSVC quoted form #include behavior documented. https://msdn.microsoft.com/en-us/library/36k2cdd4.aspx
Bug 189693 – [Win][Clang] warning: #include resolved using non-portable Microsoft search rules as: ..\..\Source\WTF\wtf/unicode/utf8.h https://bugs.webkit.org/show_bug.cgi?id=189693
-- Fujii
,
_______________________________________________ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
-- Regards, Konstantin
On Oct 31, 2018, at 7:52 AM, Konstantin Tokarev <annulen@yandex.ru> wrote:
31.10.2018, 05:18, "Fujii Hironori" <fujii.hironori@gmail.com <mailto:fujii.hironori@gmail.com>>:
wtf/unicode/UTF8.h is conflicting with ICU header in MSVC builds. I'd like to rename wtf/unicode/UTF8.h to wtf/unicode/WTFUTF8.h. Any suggestion?
What about Unicode.h or UnicodeHelpers.h? UTF8.h deals with UTF16 as well
While I don’t love other of those names, I do like the idea of avoiding awkward “WTF” in the filename. I don’t think it’s right to say “deals with UTF16”; this header contains only functions about dealing with UTF-8 and converting UTF-8 to and from other encodings (and yet those other encoding include UTF-16). With a few seconds thought I am thinking that maybe UTF8Conversion.h or UTF8Transcoding.h are possible better ideas for new names. Neither is completely accurate. If we were going to add the word “helpers” than I would say UTF8Helpers.h, but I really don’t like those kinds of word in header names (“utilities”, “helpers”, “functions”, “classes”). A separate issue once we rename: the header is also pretty old and crufty. Eventually we might want to remove or refine the functions in here. Not sure how widely they are used. — Darin
Thank you for the feedback, Konstantin and Darin. On Thu, Nov 1, 2018 at 1:52 AM Darin Adler <darin@apple.com> wrote:
With a few seconds thought I am thinking that maybe UTF8Conversion.h or UTF8Transcoding.h are possible better ideas for new names. Neither is completely accurate. If we were going to add the word “helpers” than I would say UTF8Helpers.h, but I really don’t like those kinds of word in header names (“utilities”, “helpers”, “functions”, “classes”).
Sounds good. I take UTF8Conversion.h.
A separate issue once we rename: the header is also pretty old and crufty. Eventually we might want to remove or refine the functions in here. Not sure how widely they are used.
There are 8 functions in the header. Following 2 functions are used only in JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp. * UTF8SequenceLength * decodeUTF8Sequence Following 3 functions are used only in WTF/wtf/text/AtomicStringImpl.cpp * calculateStringHashAndLengthFromUTF8MaskingTop8Bits * equalUTF16WithUTF8 * equalLatin1WithUTF8 Following 3 functions are widely used * convertUTF8ToUTF16 * convertLatin1ToUTF8 * convertUTF16ToUTF8 Any suggestions are welcome to improve.
participants (4)
-
Darin Adler
-
Fujii Hironori
-
Konstantin Tokarev
-
Mathias Bynens