-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encoding problem in non-ascii characters #1165
Comments
Comment by LadyCailin I don't think this is a problem with MethodScript in general. I have supported UTF-8 in source code for many years now. I also double checked, and the console method uses the appropriate print mechanism to support printing it correctly on console. However, I did find this online: https://www.spigotmc.org/threads/utf-8-support.100607/ which seems to suggest to me that perhaps the server itself does not support UTF-8 by default? Anyways, I think I need more information in order to look into this further, or perhaps @PseudoKnight could try this on his server, and see if he can replicate it. It appears anyways that this is a Minecraft related problem, not a MethodScript problem, per se. Here are some other higher order characters that can be tested with: æøå |
Comment by bexco2010 @LadyCailin Console Output is not problem of Spigot Server. I tried non-ascii characters in interpreter mode. but it's not working either. |
Comment by bexco2010 @LadyCailin File encoding problem fixed with -Dfile.encoding=UTF-8 parameter. but I think CommandHelper should have encoding option in file options. So we can define encoding type in file. |
Comment by LadyCailin Hmm, ok. Well, it works for me on Mac. What OS are you on? Looks like Windows? In general, I intend on supporting UTF-8 by default, I can look into supporting other character encodings as well, but anyways for your use case, MethodScript should just work out of the box. If you are in fact on Windows, I can take a look at that tomorrow when I have access to a Windows machine. |
Comment by bexco2010 @LadyCailin Windows 10. |
Comment by PseudoKnight I can confirm this issue locally on my Windows 7 computer. Though Windows console and Power Shell can't display "안녕" at all on my machine, "æøå" is displayed as entirely different characters after being passed through console() in jar interpreter mode. However, the text logs are correct. This means it's only incorrect in the Windows console itself. But if I use a different method of logging to console, like just typing it in chat, then it displays correctly in console. So Windows console and Power Shell just aren't working with whatever method CH is using. |
Comment by PseudoKnight As an aside: I wonder why I can't display Hangul in my console. Even installing the Korean language pack and trying all the available fonts didn't work. |
This doesn't appear to be an issue with the new Windows Terminal. |
CMDHELPER-3171 - Reported by bexco2010
If we(non-ascii users) write non-ascii character(which is hangul(korean) in my case), CommandHelper won't show correct letters on UTF-8 Encoded File. This means If code is transfered to another computer which uses diffrent encoding(EUC-KR to EUC-JP for example), code with non-ascii characters will shows broken letters when executed.
So, CommandHelper needs to set default encoding to UTF-8 for non-ascii users.
I attached photo which shows I tried to message "안녕" to player in UTF-8 Encoded MethodScript file.
plus, If try to send non-ascii message to console(tmsg() or console() function), It shows broken message.
please check console output with non-ascii characters, too.
Thanks.
The text was updated successfully, but these errors were encountered: