Comments (2)
I believe this can be resolved by adding this environment variable to your launch script:
set JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8
- Windows
or
export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8
- Linux/OS X
Ideally this would've been included initially when beatoraja came out, but instead we're too late in development ... it would break a lot of installs when the file is ANSI encoded rather than UTF-8. note, if your config.json is not UTF-8 there might be strange bugs (i.e: save/load of certain features don't work when ANSI!)
from beatoraja.
Okay, so after I studied Java by myself, I've figured out that a usage of FileWriter
and FileReader
causes this problem because that classes use the system encoding when its OS is Windows (which is obviously not UTF-8 in general condition.)
beatoraja/src/bms/player/beatoraja/PlayerConfig.java
Lines 894 to 918 in 89e6ab1
Of course, you can use such a 'UTF-8 fix', editing a batch file with an addition of an environment variable JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8
. However, when it comes to executable binaries like the one in Mocha-Repository, we can't do that black magic.
Luckily, there are standard classes that can read/write files in specific locale, OutputStreamWriter
and InputStreamReader
. If these classes are used for this section, users won't need that 'UTF-8 fix' anymore.
try (OutputStreamWriter writer =
new OutputStreamWriter(new FileOutputStream(Paths.get(playerpath + "/" + player.getId() + "/config.json"), StandardCharsets.UTF_8))
) {
The problem is, if users who haven't used a 'UTF-8 fix' (typically users who are using Windows in Shift-JIS encoding), their configuration file will be deleted because it has not been in UTF-8 encoding so they'll loose all their configurations.
This can be solved by using an external library such as icu4j, but I'm not sure it is proper solution for this case. Any ideas?
(Sorry for my poor English)
from beatoraja.
Related Issues (20)
- 特定条件でライバルネームを正しく取得できない HOT 1
- Support WQXGA(2560x1600) borderless window mode
- Microstutters on AMD GPUs and/or CPUs? HOT 2
- [FEATURE REQUEST]Notes offset - y
- [FEATURE REQUEST] Compatibility with Korean text encoding
- Please change the way play mode is exited.
- [Feature Request] MSS note and Multi Hold Note Support
- Mocha repository jar contains different bytedeco libraries compared to source
- [Request] Multiple Keybind Support
- SUD+の計算方法の変更
- [IR] beatoraja sends the same data when at least one outdated IR jar is loaded HOT 1
- 機能要望:LN押し直し猶予時間の調整機能
- certain skins, such as the M.H skin, are broken
- Can't load IR that implemented in Kotlin
- Question about Midi keyboard pitch wheels.
- [Request] Add much needed functionality to the "Illegal BMS" dialogue HOT 2
- [要望]ライバルフォルダの充実化
- Percentage of StaticTargetProperty is wrong
- [feature request, skin] judgerank value property for #DEFEXRANK defined songs
- [Feature Request] BGA Preview Feature
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from beatoraja.