MCPcopy Create free account
hub / github.com/BombusMod/BombusMod / convCp1251ToUnicode

Method convCp1251ToUnicode

src/main/java/util/Strconv.java:44–56  ·  view source on GitHub ↗
(final String s)

Source from the content-addressed store, hash-verified

42 }
43
44 public static String convCp1251ToUnicode(final String s){
45 if (s==null) return null;
46 StringBuffer b=new StringBuffer(s.length());
47 for (int i=0;i<s.length();i++){
48 char ch=s.charAt(i);
49 if (ch>0xbf) ch+=0x410-0xc0;
50 if (ch==0xa8) ch=0x401;
51 if (ch==0xb8) ch=0x451;
52 b.append(ch);
53 //setCharAt(i, ch);
54 }
55 return b.toString();
56 }
57
58 public static String convUnicodeToCp1251(final String s){
59 if (s==null) return null;

Callers 1

MessageParserMethod · 0.95

Calls 2

appendMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected