mahesh-desu opened a new pull request, #51388: URL: https://github.com/apache/arrow/pull/51388
### Rationale for this change The vendored [utfcpp](https://github.com/nemtrif/utfcpp) under `cpp/src/arrow/vendored/utfcpp/` is pinned to 3.1.1. This bumps it to upstream **4.2.0**, which includes a UTF-8 decode optimization and makes UTF-16 iteration throw on invalid input. This resolves GH-51009. ### What changes are included in this PR? - Replace vendored `core.h`, `checked.h`, `cpp11.h` with upstream v4.2.0 (byte-identical to upstream). - Add `cpp17.h` and `cpp20.h`. Upstream `checked.h` includes one of these based on `__cplusplus`; Arrow forces C++20, so `cpp20.h` is the path taken. Without these files the build breaks. - Remove the obsolete `#ifdef NOEXCEPT` / `#undef NOEXCEPT` block in `cpp/src/arrow/util/utf8.cc` (4.x renamed the macro to `UTF_CPP_NOEXCEPT`). - Update the vendored README version string from 3.1.1 to 4.2.0. ### Are these changes tested? - The five vendored files are byte-identical to upstream v4.2.0 (verified via SHA256 and git blob hashes). - Local build on MSVC 14.50 with `/std:c++20`: `arrow-utility-test` builds clean and `ctest -R "^arrow-utility-test$"` passes (1/1). - The utfcpp-backed gtest subset passes 18/18 (`UTF8ValidationTest`, `UTF8ToWideString`, `WideStringToUTF8`, `UTF8StringToUTF16`, `UTF16StringToUTF8`, etc.). The existing `cpp/src/arrow/util/utf8_util_test.cc` already covers valid and invalid input, including lone surrogates, which matches 4.2.0's new "UTF-16 iteration throws on invalid" behavior. ### Are there any user-facing changes? No public API changes. Arrow only uses the 3-argument iterator overloads (`utf8to16`/`utf8to32`/`utf16to8`/`utf32to8`), which are unchanged in 4.2.0. ### Was AI used for this PR? Yes. The code change and this description were generated by an AI coding assistant (opencode). The human submitter reviewed the change and verified the build and tests locally before submission. **PR code and description written by:** - [ ] Human - [x] AI **Reviewed before submission by:** - [x] Human - [ ] AI - [ ] Not reviewed -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
