mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-11-07 08:52:59 +00:00
Merge pull request #238 from SquidDev-CC/feature/binary-handles
Refactor the filesystem and HTTP code
This commit is contained in:
@@ -41,4 +41,17 @@ public class StringUtil
|
||||
{
|
||||
return net.minecraft.util.text.translation.I18n.translateToLocalFormatted( key, format );
|
||||
}
|
||||
|
||||
public static byte[] encodeString( String string )
|
||||
{
|
||||
byte[] chars = new byte[ string.length() ];
|
||||
|
||||
for( int i = 0; i < chars.length; ++i )
|
||||
{
|
||||
char c = string.charAt( i );
|
||||
chars[ i ] = c < 256 ? (byte) c : 63;
|
||||
}
|
||||
|
||||
return chars;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user