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 unicode #9

Open
whaqzhzd opened this issue Oct 4, 2021 · 9 comments
Open

chinese unicode #9

whaqzhzd opened this issue Oct 4, 2021 · 9 comments

Comments

@whaqzhzd
Copy link

whaqzhzd commented Oct 4, 2021

After I encode Chinese in unicode in my script, I save the single slash, but the file is double slash, which causes an error in the encoding of the Chinese content, how should I save the Chinese content correctly?

image
image
image

@bjorn
Copy link
Member

bjorn commented Oct 5, 2021

Isn't the double slash simply the result of the JSON encoding? If you load this JSON file and print out the string, it should again have only a single slash.

Btw, are you sure you need this special handling of Chinese characters?

@whaqzhzd
Copy link
Author

whaqzhzd commented Oct 5, 2021

@bjorn Think You, Yes, if you don't encode it this way, the output will be garbled after the file

image

@whaqzhzd
Copy link
Author

whaqzhzd commented Oct 5, 2021

Re-introduce the json file with the double slash, neither the tild editor nor the js can handle this file correctly

image

image

image

But the single slash can be correctly parsed

image

image

image

@bjorn
Copy link
Member

bjorn commented Oct 5, 2021

Yes, if you don't encode it this way, the output will be garbled after the file

I guess there is some encoding bug we need to fix. Could you provide the full script, or at least a small functional one that reproduces the issue (and not as screenshot)?

@whaqzhzd
Copy link
Author

whaqzhzd commented Oct 5, 2021

Sure, with pleasure!

@whaqzhzd
Copy link
Author

whaqzhzd commented Oct 5, 2021

@bjorn This file format.zip
All calls to the ch2Unicdoe function have been fixed
Just create a Chinese objectlayer in the editor and export it with this format to reproduce it!

@bjorn
Copy link
Member

bjorn commented Oct 5, 2021

@whaqzhzd Hmm, regardless of the unicode issue, why are you writing a JS script that exports to basically the same format as the JSON plugin? In the script I read:

//  The main purpose of this script is to restore the
//  exported json format using a js script. So that 
//  developers can easily and quickly develop the map 
//  twice

However, if backwards compatibility is a problem with the changes made to the JSON format since Tiled 1.2, you can switch to the "json1" plugin in the Preferences to use the format that was used until Tiled 1.1. Would that be a solution for you?

@whaqzhzd
Copy link
Author

whaqzhzd commented Oct 5, 2021

we will exclude object level data except that the export format is the same as json. Then reassemble the data to export to a new file, such as pathfinding data, and we will build the graph data in the script to better control the map made by tiled in the development game. Of course there are other features. Such as streamlining the format or generating configuration files more easily.

@whaqzhzd
Copy link
Author

whaqzhzd commented Oct 5, 2021

@bjorn ^_^

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