Skip to content

Instantly share code, notes, and snippets.

@dmikurube
Created June 30, 2015 15:40
Show Gist options
  • Select an option

  • Save dmikurube/608dc53ff3ecd5810482 to your computer and use it in GitHub Desktop.

Select an option

Save dmikurube/608dc53ff3ecd5810482 to your computer and use it in GitHub Desktop.
import java.io.BufferedWriter;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
public class Symbols {
public static void main(String[] args) throws IOException {
BufferedWriter writer = Files.newBufferedWriter(Paths.get("hoge"), Charset.forName("UTF-8"), StandardOpenOption.CREATE_NEW);
String EUR = "\u20AC";
String GBP = "\u00A3";
String JPY = "\u00A5";
writer.write(EUR);
writer.newLine();
writer.write(GBP);
writer.newLine();
writer.write(JPY);
writer.newLine();
writer.write('\u0061');
writer.newLine();
writer.write('\u3042');
writer.newLine();
writer.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment