private static bool IsOnlyDoubleByteKanji(String content) {
byte[] bytes;
try {
bytes = Encoding.GetEncoding("Shift_JIS").GetBytes(content);
}
catch {
return false;
}
int length = bytes.Length;
if (length % 2 != 0) {
return false;
}
for (int i = 0; i < length; i += 2) {
int byte1 = bytes[i] & 0xFF;
if ((byte1 < 0x81 || byte1 > 0x9F) && (byte1 < 0xE0 || byte1 > 0xEB)) {
return false;
}
}
return true;
}