Focus on Chinese characters, Microsoft Visual Studio International Pack 1.0 SR1 simplified and Traditional Chinese conversion, Chinese character attributes, numeric value to uppercase Conversion

Source: Internet
Author: User

Visual Studio International Pack contains a set of class libraries that extend the. NET
Framework supports global software development. Using the classes provided by this class library,. NET developers can easily create software applications that support multiple cultures and languages. SR1 includes
Japanese Kana Conversion Library and Japanese Yomi Auto-Completion
Library.

Visual Studio International Pack contains a set of class libraries that extend the. NET
Framework supports global software development. Using the classes provided by this class library,. NET developers can easily create software applications that support multiple cultures and languages.
The software package version 1.0 provides the following seven components to enhance. NET Framework support for global software application development.

  • East Asia Numeric Formatting Library-supports Formatting lowercase Numeric strings into uppercase Numeric strings in simplified Chinese, traditional Chinese, Japanese, and Korean.
  • Japanese Kana Conversion Library-supports converting Japanese Kana to another Japanese character.
  • Japanese Text Alignment Library-supports a Japanese-specific Alignment format.
  • The Japanese Yomi Auto-Completion Library-Class Library supports the input of the daily input method and an example of a text box control.
  • Korean Auto Complete TextBox Control-supports smart sensing of Korean input methods and text box controls automatically completed by input.
  • Simplified Chinese Pin-Yin Conversion Library-supports obtaining common attributes of Simplified Chinese characters, such as pinyin, polyphonic words, Homophone Words, and strokes.
  • Traditional
    Chinese to Simplified Chinese Conversion Library and Add-In Tool-
    Supports conversion between simplified and traditional Chinese characters. This component also contains a plug-in (Add-in) in the integrated development environment of Visual Studio that supports conversion between simplified and Traditional Chinese resource files.


The released SR1 fixes Software defects in the Japanese Kana Conversion Library and Japanese Yomi Auto-Completion Library, but not in other libraries. ,

Do you have a lot of trouble to convert traditional Chinese to simplified Chinese, numbers to uppercase, and Chinese characters to PinYin? I have met it all, so I think this is really good... the disadvantage of the US is that the numbers are written in uppercase, which is different from the Chinese habits.

Code example:

Using System;
Using Microsoft. International. Converters. PinYinConverter;
Using Microsoft. International. Converters. TraditionalChineseToSimplifiedConverter;
Using System. Collections. ObjectModel;
Using Microsoft. International. Formatters;

Namespace HanZiToPinYinAndNumberToHanZi
{
Public class andresconvertutils
{
/// <Summary>
/// Obtain the information of Chinese Characters
/// </Summary>
/// <Param name = "chChar"> </param>
Public static void getChineseChartInfo (Char chChar)
{
ChineseChar chineseChar = new ChineseChar (chChar );

Console. WriteLine ("Processing Chinese characters .....");

// Strokes of Chinese Characters
String bh = chineseChar. StrokeNumber. ToString ();

Console. WriteLine ("Chinese character" + chChar. ToString () + "number of strokes:" + bh );

// Number of Pinyin characters
String pyNumber = chineseChar. PinyinCount. ToString ();

Console. WriteLine ("Chinese character" + chChar. ToString () + "pinyin count:" + pyNumber );

// Pinyin
ReadOnlyCollection <string> pys = chineseChar. Pinyins;
Foreach (string item in pys)
{
If (item! = Null)
{
Console. WriteLine ("Chinese character" + item. ToString () + "pinyin:" + item );
}
}

Console. WriteLine ("processing pinyin .....");

Char [] chchars = chinesechar. getchars (pys [0]. tostring ());

Console. writeline ("pinyin" + pys [0]. tostring () + "A total of Chinese characters:" + chchars. length. tostring () + ");

Foreach (char chcharitem in chchars)
{
Console. writeline ("selected Chinese characters:" + chcharitem. tostring ());
}

Console. writeline ("processing is finished, press any key to exit running .....");

Console. Readline ();
}

/// <Summary>
/// Tool for converting simplified Chinese characters into traditional Chinese characters
/// </Summary>
Public static void jianFanConvert ()
{
Console. WriteLine ("simplified to traditional Chinese .....");

String simText = "Welcome to [Lu yongchao]";
String traText = ChineseConverter. Convert (simText, ChineseConversionDirection. SimplifiedToTraditional );

Console. WriteLine ("simplified Chinese:" + simText );
Console. WriteLine ("simplified to traditional Chinese test results:" + traText );

String simText2 = ChineseConverter. Convert (traText, ChineseConversionDirection. TraditionalToSimplified );
Console. WriteLine ("Test Result converted from traditional Chinese to simplified Chinese:" + simText2 );

Console. WriteLine ("processing is finished, press any key to exit running .....");

Console. ReadLine ();
}

/// <Summary>
/// Process the conversion of values and Chinese characters
/// </Summary>
/// <Param name = "number"> </param>
Public static void getNumberHanzi (double number)
{
Console. WriteLine ("processing the conversion between numeric data and Chinese characters ....");

EastAsiaNumericFormatter eastAsiaNumericFormatter = new EastAsiaNumericFormatter ();

String NumberToHanziResult = string. Format (new EastAsiaNumericFormatter (), "{0: Ln}", number );

The upper case of Console. WriteLine ("number" + number. ToString () + "is:" + NumberToHanziResult );


Console. WriteLine ("processing is finished, press any key to exit running .....");

Console. ReadLine ();
}
}

Public class StartUpClass
{
Static void Main (string [] args)
{
 
Char chChar = 'lu ';

// Obtain the attributes of Chinese Characters
// Andresconvertutils. getChineseChartInfo (chChar );

// Mutual conversion between simplified and Traditional Chinese
// Andresconvertutils. jianFanConvert ();

// Conversion of numbers and Chinese characters
Andresconvertutils. getNumberHanzi (9111.87 );
}
}
}

 

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.