PlatformStringOf - C++ Builder

C++ Builder 参考手册 ➙ System::Sysutils ➙ PlatformStringOf


把字节数组转成字符串,采用 UTF-16 编码

头文件:#include
命名空间:System::Sysutils
函数原型:

System::UnicodeString __fastcall PlatformStringOf(const System::DynamicArray Value);

参数:

  • Value:字节数组

返回值:

  • 把字节数组 Value 按照 UTF-16 编码转成的字符串;
  • 与 StringOf 比较:
    • StringOf 采用系统默认的编码,UTF-8 或 ANSI (请参考《C++ Builder 的字符串类型、字符类型、字符编码》);
    • PlatformStringOf 采用 UTF-16 编码;
  • PlatformStringOf 内部通过调用 TEncoding::Unicode->GetString(Value); 来实现的。

相关:

  • 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
  • std::strlen, std::_fstrlen, std::_tcslen, std::wcslen

C++ Builder 参考手册 ➙ System::Sysutils ➙ PlatformStringOf

你可能感兴趣的:(PlatformStringOf - C++ Builder)