📄 byte2unicodedecoder.java
字号:
package inline.sys;
public class Byte2UnicodeDecoder
{
private static boolean decode = false;
static
{
decode = (Globalization.getSystemLCID() == Globalization.RUSSIAN_LCID);
}
public static String convert(String s)
{
if (!decode) return s;
byte ba[] = s.getBytes();
char ca[] = new char[ba.length];
for(int i = 0; i < ba.length; i++)
{
ca[i] = DecodeB2UChar(ba[i]);
}
return new String(ca);
}
private static char DecodeB2UChar(int in)
{
if(in < 0) in += 256;
char ch = (char)in;
if(ch < 128)
return ch;
if(in == 168)
return '\u0401';
if(in == 184)
return '\u0451';
if(in >= 192 && in <= 255)
return (char)(in + 848);
return ch;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -