[BDS-18961] Bedrock Dedicated Server Unknown encoding error Created: 14/Jan/24 Updated: 10/Jul/24 Resolved: 10/Jul/24 |
|
| Status: | Resolved |
| Project: | Bedrock Dedicated Server |
| Affects Version/s: | 1.20.51 |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | ArcherLee127chen | Assignee: | Unassigned |
| Resolution: | Awaiting Response | Votes: | 1 |
| Labels: | command | ||
| Environment: |
Windows Server 2022 Datacenter 21H2 inter 20348.1970 bedrock_server.exe for bedrock 1.20.51 |
||
| Attachments: |
|
| Confirmation Status: | Unconfirmed |
| Description |
|
Even though Minecraft Bedrock 1.20 claims to support UTF-8 and the command "say 你好" displays chinese correctly when entering it directly into the bedrock_server.exe, I encountered an issue when attempting to run bedrock_server.exe as a subprocess in a Python program. This screenshot shows the official bedrock_server.exe running independently.
but in python
I wrote it into a Python subprocess to facilitate remote command sending and receiving comments. Originally, I intended for comments on my live channel to be displayed as dialogues in Minecraft. However, I discovered that Chinese characters were being compiled into Latin letters.
Even though I have enabled UTF-8 encoding for the pipeline, it still doesn't work. This issue doesn't exist when interacting with other programs. I suspect that the subprocess form may cause some internal code in the server program to handle UTF-8 characters in the same way as in previous versions, converting them into ISO-8859-1.
I have another piece of code here that can be used to illustrate what happened.
I have attached my code in the comments section If a solution can be identified, I would be extremely grateful. If the issue lies within the server program itself, I sincerely hope it can be resolved. Thank you! |
| Comments |
| Comment by [MCQA] Bartłomiej Słodkowski [ 10/Jul/24 ] |
|
Thank you for your report! However, this issue has been temporarily closed as Awaiting Response. Is this still an issue in the latest version? If yes, could you please add it to the affected versions (or mention it if you are not the reporter)? This ticket will automatically reopen when you reply. Quick Links: |
| Comment by JndjanBartonka [ 30/Jan/24 ] |
|
I guess it only happening on windows, in my java project i have same issue, but on linux it working, its windows(system) issue |
| Comment by ArcherLee127chen [ 15/Jan/24 ] |
|
If possible, I suggest adding built-in character encoding functionality for commands like 'say' and 'tell', 'tellraw', etc. For example:
/tellraw @a {"rawtext":[\{"text":"ä½ å¥½,"encoding":['iso-8859-1','utf-8']}]} > 你好
/say "ä½ å¥½" ['iso-8859-1','utf-8'] > [server]你好 |
| Comment by ArcherLee127chen [ 14/Jan/24 ] |
|
#This is my Python code
#from selenium import webdriver def server_order(msg):
def count_subdirectories(folder_path): def run_scripts(): # a message sender
def read_live(): # a message sender def run_popen(): try: if lastsend != time:
async def handle_client(websocket, path): # functions for history_entry in history_queue: # listening messages from websocket client if message == "stop": elif message == "/new_world": # create target folder old_name = f"old_world{count_subdirectories(old_worlds_folder) + 1}" shutil.move("worlds/Bedrock level", os.path.join(old_worlds_folder, old_name)) if process: wt = 3 process = subprocess.Popen(['bedrock_server.exe'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, except websockets.exceptions.ConnectionClosedOK: finally: async def main(): start_server_coroutine = websockets.serve(handle_client, "xxx.xx.xxx.xx", 8765) # Connect your websocket client here, if you have one, otherwise ignore it # create task and run it await asyncio.Future() if _name_ == "_main_": |