Skip to content

Commit

Permalink
read as utf8 in windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Craftingmod committed Feb 27, 2018
1 parent 152a345 commit 022d789
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/main/java/net/tarks/craftingmod/nccauth/Main.java
Expand Up @@ -17,6 +17,7 @@
import java.io.*;
import java.net.URISyntaxException;
import java.net.URLDecoder;
import java.nio.charset.Charset;
import java.security.CodeSource;
import java.time.*;
import java.time.format.DateTimeFormatter;
Expand All @@ -41,7 +42,7 @@ public Main(String[] args){
trace("Config file: " + config_file.getAbsolutePath());
if(config_file.exists() && config_file.canRead()){
try {
JsonReader reader = new JsonReader(new FileReader(config_file));
JsonReader reader = new JsonReader(new InputStreamReader(new FileInputStream(config_file), Charset.forName("utf-8")));
cfg = g.fromJson(reader, new TypeToken<Config>(){}.getType());
} catch (FileNotFoundException e) {
e.printStackTrace();
Expand Down
Expand Up @@ -24,9 +24,8 @@
import net.tarks.craftingmod.nccauth.Util;

import javax.security.auth.login.LoginException;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.*;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
import java.util.StringJoiner;
Expand Down Expand Up @@ -56,7 +55,7 @@ public DiscordPipe(Config c,ICommander cmd){

if(dbfile.exists() && dbfile.canRead()){
try {
JsonReader reader = new JsonReader(new FileReader(dbfile));
JsonReader reader = new JsonReader(new InputStreamReader(new FileInputStream(dbfile), Charset.forName("utf-8")));
authlist = g.fromJson(reader, new TypeToken<UserCafeDB>(){}.getType());
} catch (FileNotFoundException e) {
e.printStackTrace();
Expand Down
2 changes: 1 addition & 1 deletion target/maven-archiver/pom.properties
@@ -1,5 +1,5 @@
#Generated by Maven
#Tue Feb 27 13:51:30 KST 2018
#Tue Feb 27 14:18:02 KST 2018
version=1.0.0
groupId=net.tarks.craftingmod
artifactId=ncc_auth

0 comments on commit 022d789

Please sign in to comment.