How do I load a dictionary from an external file?

Get help using Construct 2

Post » Mon Oct 31, 2016 8:11 pm

I need to read a dictionary from a txt file in "C:/..."
I use NWjs.ReadFile() and I think this function add some special character that make Dic can't load the Json.
The Dic is empty, is there any way to know the error?
If someone know any other way to do it, please tell me.
Thanks you.

Example:
.capx
https://drive.google.com/open?id=0B9sGs ... UxCSGFKMXc

.txt (dictionary)
https://drive.google.com/open?id=0B9sGs ... jVQb3dnVGs
NOTE: copy it in c:/ or change the path in "FOLDER_MOD" variable.
B
10
S
5
G
1
Posts: 26
Reputation: 1,452

Post » Mon Oct 31, 2016 9:21 pm

you have a ghost character, :o at the beginning of json string .
Image

you need to save .txt file wih ANSI encoding...
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Mon Oct 31, 2016 11:12 pm

Thank you. It work.

How you detect it? In notepad++ I don't see it.

I need to use latin languages in this .txt (áàü...), I save the .txt with encoding "UTF8 without BOM", I hope all work. Thanks again.
B
10
S
5
G
1
Posts: 26
Reputation: 1,452


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 23 guests