Extract WideToUtf8 helper to utf8.h.

This change allows to reuse the conversion of `wchar_t` into UTF-8 from other code.
It also adds tests that covers the conversion.

PiperOrigin-RevId: 755365598
Change-Id: I0f1c0b7949dec3c9874be99f01540748436532ce
This commit is contained in:
Omer Mor
2025-05-06 07:36:06 -07:00
committed by Copybara-Service
parent 5fb86a93d2
commit dd69c96310
6 changed files with 253 additions and 60 deletions

View File

@@ -329,6 +329,7 @@ cc_test(
visibility = ["//visibility:private"],
deps = [
":internal",
":string_view",
"//absl/base:core_headers",
"@googletest//:gtest",
"@googletest//:gtest_main",
@@ -1316,6 +1317,7 @@ cc_library(
linkopts = ABSL_DEFAULT_LINKOPTS,
visibility = ["//visibility:private"],
deps = [
":internal",
":strings",
"//absl/base:config",
"//absl/base:core_headers",