CJK characters identify sample


///
/// Ref:
/// http://en.wikipedia.org/wiki/CJK_Unified_Ideographs
/// http://blog.oasisfeng.com/2006/10/19/full-cjk-unicode-range/
/// http://www.unicode.org/ucd/filemoved.html
///

///
///
static public string CommontCJKIdentify(string text)
{
if (text.Any(c => c >= 0x3040 && c <= 0x309F))
{ return "J"; }
else if (text.Any(c => c >= 0X30A0 && c <= 0x30FF))
{ return "J"; }
else if (text.Any(c => c >= 0X31F0 && c <= 0x31FF))
{ return "J"; }
else if (text.Any(c => c >= 0XAC00 && c <= 0xD7AF))
{ return "K"; }
else if (text.Any(c => c >= 0X1100 && c <= 0x11FF))
{ return "K"; }
else if (text.Any(c => c >= 0X3130 && c <= 0x318F))
{ return "K"; }
else if (text.Any(c => c >= 20000 && c <= 0xFA2D))
{
return "C";
}
else
{ return "Others"; }
}

沒有留言:

張貼留言