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

chinese comment are displayed as garbled characters #218

Open
JavaSCU opened this issue Jan 13, 2025 · 0 comments
Open

chinese comment are displayed as garbled characters #218

JavaSCU opened this issue Jan 13, 2025 · 0 comments

Comments

@JavaSCU
Copy link

JavaSCU commented Jan 13, 2025

eg mktxp_dhcp_lease_info

I use Winbox in Windows 10 to input Chinese comment for RouterOS. The characters obtained from mkxtp are garbled.

This issue is resolved through the following modification. It is recommended to add MIKROTIK_ENCODING to the configuration file. And when calling decode in get_python_value function, add the "ignore" parameter.

/mktxp/flow/router_connection.py
MIKROTIK_ENCODING = 'GBK'
...
routeros_api.api_structure.StringField.get_python_value = lambda _, bytes: bytes.decode(MIKROTIK_ENCODING, "ignore")

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

1 participant