C++ Builder 参考手册 ➙ System::Sysutils ➙ WideStringOf
把字节数组转成字符串,采用 UTF-16 编码
头文件:#include <System.SysUtils.hpp>
命名空间:System::Sysutils
函数原型:
System::UnicodeString __fastcall WideStringOf(const System::DynamicArray<System::Byte> Value);
参数:
- Value:字节数组
返回值:
- 把字节数组 Value 按照 UTF-16 编码转成的字符串;
- 通过 TEncoding.Unicode.GetString(Value) 实现;
- StringOf、PlatformStringOf 、WideStringOf 比较:
• StringOf 采用系统默认的编码,UTF-8 或 ANSI (请参考《C++ Builder 的字符串类型、字符类型、字符编码》);
• PlatformStringOf 和 WideStringOf 实现完全相同的功能,采用 UTF-16 编码。
相关:
- System::Sysutils::BytesOf
- System::Sysutils::WideBytesOf
- System::Sysutils::PlatformBytesOf
- System::Sysutils::StringOf
- System::Sysutils::WideStringOf
- System::Sysutils::PlatformStringOf
- System::Sysutils::ByteLength
- System::Sysutils::CharLength
- System::Sysutils::StrCharLength
- System::Sysutils::AnsiLastChar
- System::Sysutils::AnsiStrLastChar
- System::Sysutils::AnsiPos
- System::Sysutils::AnsiStrPos
- System::Sysutils::AnsiStrScan
- System::Sysutils::AnsiStrRScan
- System::Sysutils::CharToElementIndex
- System::Sysutils::CharToElementLen
- System::Sysutils::ElementToCharIndex
- System::Sysutils::ElementToCharLen
- System::Sysutils::TEncoding
- System::Sysutils
- std::mblen
- std::_mbstrlen
- <cstdlib>
- std::strlen, std::_fstrlen, std::_tcslen, std::wcslen
- <cstring>
C++ Builder 参考手册 ➙ System::Sysutils ➙ WideStringOf