mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-15 11:27:26 +08:00
[allnet] Fix shop name when non-latin text used
This commit is contained in:
@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -46,7 +47,10 @@ public class AllNetController {
|
|||||||
this.HOST_OVERRIDE = HOST;
|
this.HOST_OVERRIDE = HOST;
|
||||||
this.PORT_OVERRIDE = PORT;
|
this.PORT_OVERRIDE = PORT;
|
||||||
this.MAIMAI2_NO_HTTP = MAIMAI2_NO_HTTP;
|
this.MAIMAI2_NO_HTTP = MAIMAI2_NO_HTTP;
|
||||||
this.PLACE_NAME = PLACE_NAME;
|
// Java assumes every application.properties as ISO-8859-1 (wtf), so we need to "correctly" convert it to UTF-8
|
||||||
|
// More better way to this is to use XML or yaml format as these treated as UTF-8
|
||||||
|
// but I rather use hack than breaking backward compatibility.. for now
|
||||||
|
this.PLACE_NAME = new String(PLACE_NAME.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/")
|
@GetMapping("/")
|
||||||
|
|||||||
Reference in New Issue
Block a user