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

[REQUEST] Let API TextFile support encoding #3171

Closed
finscn opened this issue Nov 5, 2021 · 3 comments
Closed

[REQUEST] Let API TextFile support encoding #3171

finscn opened this issue Nov 5, 2021 · 3 comments
Assignees
Labels
documentation Issue related to the Tiled Manual.

Comments

@finscn
Copy link

finscn commented Nov 5, 2021

When I set a custom property with Chinese on windows , it doesn't use unicode/utf8, so , the char is wrong.

I hope the API about TextFile could support set encoding

@bjorn
Copy link
Member

bjorn commented Nov 5, 2021

I hope the API about TextFile could support set encoding

There is https://www.mapeditor.org/docs/scripting/classes/textfile.html#codec, does that help?

When I set a custom property with Chinese on windows , it doesn't use unicode/utf8, so , the char is wrong.

Can you provide a bit more context? Is something broken regarding encoding in Tiled, or just in your extension plugin?

@finscn
Copy link
Author

finscn commented Nov 5, 2021

how to set codec ?

"utf8" , "utf-8" , "UTF8" "UTF-8" ....

I think there should be more examples and informations .

@bjorn
Copy link
Member

bjorn commented Nov 5, 2021

I think there should be more examples and informations .

I agree. For now, you can find a list of supported encodings here: https://doc.qt.io/qt-5/qtextcodec.html#details

But, it will change once Tiled is built against Qt 6, then only these will be supported: https://doc.qt.io/qt-6/qstringconverter.html#Encoding-enum

@bjorn bjorn added the documentation Issue related to the Tiled Manual. label Dec 7, 2021
@bjorn bjorn self-assigned this Jan 19, 2022
@bjorn bjorn closed this as completed in 0c7b83d Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Issue related to the Tiled Manual.
Projects
No open projects
Status: Done
Development

No branches or pull requests

2 participants