private void setSoldierDescription( String soldierDictionary, String displayName, String description) { try { PrintWriter out = new PrintWriter( new BufferedWriter( new OutputStreamWriter( new FileOutputStream(FileConstants.exportUnitFile, true), "UTF-16LE")), false); out.println(); String short_description = isSpecialGeneralUnit ? displayName + "麾下的精銳親兵。" : displayName; String long_description = displayName + "麾下的精銳親兵。\\n\\n"; long_description += (displayName + "的部下隨" + displayName + "征戰四方。\\n"); if (!isSpecialGeneralUnit) long_description = displayName + "。\\n"; if (description != null && description.length() > 0) long_description = ChangeCode.toShort(description); out.println("{" + soldierDictionary + "}" + displayName); out.println("{" + soldierDictionary + "_descr}" + long_description); out.println("{" + soldierDictionary + "_descr_short}" + short_description); out.close(); } catch (IOException e) { e.printStackTrace(); } try { PrintWriter out = new PrintWriter( new BufferedWriter( new OutputStreamWriter( new FileOutputStream(FileConstants.unitEnumsFile, true), "GBK")), false); out.println(); out.println(soldierDictionary); out.println(soldierDictionary + "_descr"); out.println(soldierDictionary + "_descr_short"); out.close(); } catch (IOException e) { e.printStackTrace(); } }
public void setDisplayName(String displayName) { this.displayName = ChangeCode.Change(displayName, true); }
public static void main(String g[]) { String s = "╧╡сп"; s = ChangeCode.changeGBK2ISO(s); System.out.println(s); }