サーバー日本語化

Go down

サーバー日本語化

投稿 by 構築さん on 2014-05-31, 17:11

tools.data.input.GenericLittleEndianAccessor

Code:
public final String readAsciiString(int n) {
char ret[] = new char[n];
for (int x = 0; x < n; x++) {
ret[x] = (char) readByte();
}
return String.valueOf(ret);
}



Code:
public final String readAsciiString(int n) {
//char ret[] = new char[n];
byte ret[] = new byte[n];
for (int x = 0; x < n; x++) {
ret[x] = (byte) readByte();
}
try {
String str = new String(ret, "MS932");
return str;
} catch (Exception e) {
System.err.println(e);
}
return null;
}

に変更

tools.data.output.GenericLittleEndianWriter

Code:
private static Charset ASCII = Charset.forName("US-ASCII");

の下に

Code:
private static Charset MS932 = Charset.forName("MS932");

を追加

Code:
write(s.getBytes(ASCII));



Code:
write(s.getBytes(MS932));

に変更

Code:
writeShort((short) s.length());



Code:
writeShort((short) s.getBytes().length);

に変更

tools.StringUtil

Code:
public static String getLeftPaddedStr(String in, char padchar, int length) {
StringBuilder builder = new StringBuilder(length);
for (int x = in.length(); x < length; x++) {
builder.append(padchar);
}
builder.append(in);
return builder.toString();
}



Code:
public static String getLeftPaddedStr(String in, char padchar, int lengths) {
StringBuilder builder = new StringBuilder(lengths);
for (int x = in.getBytes().length; x < lengths; x++) {
builder.append(padchar);
}
builder.append(in);
return builder.toString();
}

に変更


Code:
public static String getRightPaddedStr(String in, char padchar, int length) {
StringBuilder builder = new StringBuilder(in);
for (int x = in.length(); x < length; x++) {
builder.append(padchar);
}
return builder.toString();
}



Code:
public static String getRightPaddedStr(String in, char padchar, int lengths) {
StringBuilder builder = new StringBuilder(lengths);
for (int x = in.getBytes().length; x < lengths; x++) {
builder.append(padchar);
}
return builder.toString();
}

に変更

Code:
public static String getRightPaddedStr(String in, char padchar, int length) {

が見つからない場合は書き換える必要はないです。

キャラクター名を日本語化

tools.MaplePacketCreator

Code:
for (int x = chr.getName().length(); x < 13; x++) {// fill to maximum



Code:
for (int x = chr.getName().getBytes().length; x < 13; x++) {// fill to maximum

に変更

db.properties

Code:
&characterEncoding=SJIS
avatar
構築さん
Admin

Posts : 193
Join date : 2014/05/29

http://maplescience.forumjap.com

トップに戻る Go down

トップに戻る


 
Permissions in this forum:
返信投稿: 不可