How does one automatically check Chinese and Japanese characters in the document?

Source: Internet
Author: User

Project documents may be written in Chinese and then translated into Japanese. It is difficult to avoid missing Chinese characters, such as "total number" and "choice", if they are completely differentiated by human eyes.

Is there a way to write a program to automatically search for Chinese Characters in Excel or Word documents?

If an Excel file is converted to XML, can the Unicode Internal code be distinguished between Chinese and Japanese?

Using system;

Using system. Collections. Generic;

Using system. text;

Using system. IO;

 

Namespace consoleapplication2

{

Class Program

{

Static void main (string [] ARGs)

{

String input = "aircraft ah, F, semi-division competition, non-division competition, Division D, Division F, Division D FD さふ SDF recordable machine D フ f s speed coffee alkali speed development room ";

Byte [] DATA = encoding. Unicode. getbytes (input );

Byte [] data2 = encoding. Convert (encoding. Unicode, encoding. getencoding ("shift_jis"), data );

Byte [] data3 = encoding. Convert (encoding. getencoding ("shift_jis"), encoding. Unicode, data2 );

 

String result = encoding. Unicode. getstring (data3 );

 

For (INT I = 0; I <input. length; I ++)

{

If (input [I]! = Result [I])

{

Console. backgroundcolor = consolecolor. Cyan;

}

Else

{

Console. backgroundcolor = consolecolor. Black;

}

 

Console. Write (input [I]);

}

 

Console. readkey ();

}

}

}

 

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.