How can I print symbols from a String to a txt file?
问题 This is what I have tryed to do: String raw = dstream.readLine(); raw = raw.replaceAll("Up"," ↑ "); raw = raw.replaceAll("Right"," → "); System.out.println(raw); This is part of an easy program that receives Strings and prints them to a text file: "java -jar Server.jar > a.txt". The problem is this: Insted of ↑ or → , I get those in the txt file: "↕ ↕ ↕ ↑" 回答1: cat Upright.java public class Upright { public static void main (String args[]) { String raw ="Left - Down - Up - Right -