Skip to content
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

Suggestion for postToChat() function to send garbled messages in the game #27

Open
limingzxc opened this issue Jun 16, 2022 · 3 comments

Comments

@limingzxc
Copy link

I noticed that the bottom layer of the postToChat() function is sent to the game in utf-8 encoding, but the chat message box in minecraft seems to use gbk encoding, which causes sending non-ascii characters to become in-game Garbled, I suggest adding a parameter to allow the postToChat() function to choose the encoding of the message to avoid problems.

@Bigjango13
Copy link

I am not sure about Java Edition, but Pi edition uses CP437.

@limingzxc
Copy link
Author

I tested on minecraft Java Edition 1.11.2 server, using minecraftPythonAPI plugin

@limingzxc
Copy link
Author

I changed the encoding in the _misc_to_bytes function to gbk, so that I can use postToChat() to send Chinese without garbled characters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants