1.使用 Microsoft.International.Converters.TraditionalChineseToSimplifiedConverter 类库,一段代码即可进行转换
简体转繁体:
/// <summary>
/// 简体转换为繁体
/// </summary>
/// <param name="str">简体字</param>
/// <returns>繁体字</returns>
public static string GetTraditional(string str)
{
return ChineseConverter.Convert(str, ChineseConversionDirection.SimplifiedToTraditional);
}
繁体转简体:
/// <summary>
/// 繁体转换为简体
/// </summary>
/// <param name="str">繁体字</param>
/// <returns>简体字</returns>
public static string GetSimplified(string str)
{
return ChineseConverter.Convert(str, ChineseConversionDirection.TraditionalToSimplified);
}