Share via


UnicodeCharacters 类

定义

根据 Unicode 标准附件 #44,为应用获取有关 Unicode 字符的信息提供了一种方法。

public ref class UnicodeCharacters abstract sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class UnicodeCharacters final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public static class UnicodeCharacters
Public Class UnicodeCharacters
继承
Object Platform::Object IInspectable UnicodeCharacters
属性

Windows 要求

设备系列
Windows 10 (在 10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)

注解

在将 Unicode 字符传递给此类的任何其他方法之前,使用 GetCodepointFromSurrogatePair 准备 Unicode 字符,以便正确处理补充字符。 有关补充 Unicode 字符的讨论,请参阅 代理项和补充 字符。

处理流中的代码点的正常过程是:

  1. 使用 IsHighSurrogate 确定码位是否为高代理项。
  2. 如果不是,请将其传递给 UnicodeCharacters 的所需方法。
  3. 否则,代码点为高代理项:1。 使用 IsLowSurrogate 检查流中的下一个码位,以确定它是否为低代理项。
  4. 如果不是,则表示代码点序列无效。
  5. 否则,第二个码位是低代理项。 将高对和低对传递给 GetCodepointFromSurrogatePair 以获取可传递给所需方法的补充 Unicode 字符。

如果输入不是有效的代码点,则此类中的方法将引发无效的参数异常。

方法

GetCodepointFromSurrogatePair(UInt32, UInt32)

返回指定的高代理项和低代理项对的补充 Unicode 字符。

GetGeneralCategory(UInt32)

返回指定 Unicode 字符的 UnicodeGeneralCategory

GetNumericType(UInt32)

返回指定 Unicode 字符的 UnicodeNumericType

GetSurrogatePairFromCodepoint(UInt32, Char, Char)

返回指定补充 Unicode 字符的高和低代理项对值。

IsAlphabetic(UInt32)

确定是否可以将指定的 Unicode 字符视为字母顺序字符。

IsCased(UInt32)

确定指定的 Unicode 字符是否可以视为 (大写、小写或标题) 。

IsGraphemeBase(UInt32)

确定是否可以将指定的 Unicode 字符视为 grapheme 的开头。

IsGraphemeExtend(UInt32)

确定是否可以将指定的 Unicode 字符视为继续上一个 grapheme。

IsHighSurrogate(UInt32)

确定指定的 Unicode 字符是否为高代理项。

IsIdContinue(UInt32)

确定指定的 Unicode 字符是否可以在编程中被视为标识符的延续字符。

IsIdStart(UInt32)

确定在编程中是否可将指定的 Unicode 字符视为标识符的起始字符。

IsLowercase(UInt32)

确定是否可以将指定的 Unicode 字符视为小写字符。

IsLowSurrogate(UInt32)

确定指定的 Unicode 字符是否为低代理项。

IsNoncharacter(UInt32)

确定指定的代码点是否为非字符。

IsSupplementary(UInt32)

确定指定的 Unicode 字符是否为补充字符。

IsUppercase(UInt32)

确定是否可以将指定的 Unicode 字符视为大写字符。

IsWhitespace(UInt32)

确定是否可以将指定的 Unicode 字符视为空格。

适用于

另请参阅