#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "base/strings/sys_string_conversions.h"
#include <stddef.h>
#include <string.h>
#include <wchar.h>
#include <string_view>
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
namespace base {
std::string SysWideToUTF8(const std::wstring& wide) { … }
std::wstring SysUTF8ToWide(std::string_view utf8) { … }
#if defined(SYSTEM_NATIVE_UTF8) || BUILDFLAG(IS_ANDROID)
std::string SysWideToNativeMB(const std::wstring& wide) {
return WideToUTF8(wide);
}
std::wstring SysNativeMBToWide(std::string_view native_mb) {
return SysUTF8ToWide(native_mb);
}
#else
std::string SysWideToNativeMB(const std::wstring& wide) { … }
std::wstring SysNativeMBToWide(std::string_view native_mb) { … }
#endif
}