#ifndef BASE_STRINGS_UTF_STRING_CONVERSIONS_H_
#define BASE_STRINGS_UTF_STRING_CONVERSIONS_H_
#include <stddef.h>
#include <string>
#include <string_view>
#include "base/base_export.h"
#include "base/types/always_false.h"
#include "build/build_config.h"
namespace base {
BASE_EXPORT bool WideToUTF8(const wchar_t* src, size_t src_len,
std::string* output);
[[nodiscard]] BASE_EXPORT std::string WideToUTF8(std::wstring_view wide);
BASE_EXPORT bool UTF8ToWide(const char* src, size_t src_len,
std::wstring* output);
[[nodiscard]] BASE_EXPORT std::wstring UTF8ToWide(std::string_view utf8);
BASE_EXPORT bool WideToUTF16(const wchar_t* src,
size_t src_len,
std::u16string* output);
[[nodiscard]] BASE_EXPORT std::u16string WideToUTF16(std::wstring_view wide);
BASE_EXPORT bool UTF16ToWide(const char16_t* src,
size_t src_len,
std::wstring* output);
[[nodiscard]] BASE_EXPORT std::wstring UTF16ToWide(std::u16string_view utf16);
BASE_EXPORT bool UTF8ToUTF16(const char* src,
size_t src_len,
std::u16string* output);
[[nodiscard]] BASE_EXPORT std::u16string UTF8ToUTF16(std::string_view utf8);
BASE_EXPORT bool UTF16ToUTF8(const char16_t* src,
size_t src_len,
std::string* output);
[[nodiscard]] BASE_EXPORT std::string UTF16ToUTF8(std::u16string_view utf16);
[[nodiscard]] BASE_EXPORT std::u16string ASCIIToUTF16(std::string_view ascii);
[[nodiscard]] BASE_EXPORT std::string UTF16ToASCII(std::u16string_view utf16);
#if defined(WCHAR_T_IS_16_BIT)
[[nodiscard]] BASE_EXPORT std::wstring ASCIIToWide(std::string_view ascii);
[[nodiscard]] BASE_EXPORT std::string WideToASCII(std::wstring_view wide);
#endif
template <size_t N>
[[noreturn]] std::u16string WideToUTF16(const wchar_t (&str)[N]) { … }
template <size_t N>
[[noreturn]] std::u16string UTF8ToUTF16(const char (&str)[N]) { … }
template <size_t N>
[[noreturn]] std::u16string ASCIIToUTF16(const char (&str)[N]) { … }
template <size_t N>
std::u16string ASCIIToUTF16(char (&str)[N]) { … }
}
#endif