- This topic has 9 replies, 3 voices, and was last updated 2 years, 6 months ago by fsguegl.
-
AuthorPosts
-
2021-11-08 at 6:16 pm #46829fsgueglCustomer
Hi all,
the program that I am creating allows to save some parameters and variables in a text file which is the image of a JSOn.
The problem, as you can see from the attached image, is that the same file if I load it from the server shows the characters correctly; if, on the other hand, I load it from the local (browse), it changes accents and other characters. How can I fix it ??thanks !
FrancoAttachments:
You must be logged in to view attached files.2021-11-09 at 12:34 am #46837PascalCustomerMaybe your local file is missing correct encoding information and the webserver is defaulting to utf-8 while your browser loads the local file with an other default encoding? Just guessing…
2021-11-09 at 7:33 am #46846Yuri KovelenovStaffHi,
I think you should explicitly add the font for your app. You can use this puzzle for that
https://www.soft8soft.com/docs/manual/en/puzzles/Initialization.html#load_font
2021-11-09 at 12:25 pm #46862fsgueglCustomerThanks for your answer Yuri and Pascal,
I have explicitly loaded all the fonts that are used in the application.
But the strange thing is that the file we are seeing in the two cases is the same. It’s a file that I saved on the server and then downloaded locally.
When I load the one on the server everything is fine, when I load its twin locally there are problems.2021-11-09 at 2:22 pm #46866fsgueglCustomerI made a new test
I chose the file from server (everything ok)
I saved the file locally and i chose it for data upload (mismatched characters)
I moved the local file to the server and reloaded it (all ok)There is some anomalies in the two ways of loading the file, I think:
the local one and the one via url.2022-03-23 at 8:44 am #50537fsgueglCustomerUpgrade,
Hi Yuri,
after some time I return to this problem which remained one of the few before going online with the site (expected end of March).
I did some more in-depth tests and I am sure that the problem is in the “open file / load data” module.
I saved the file with an explicit utf8 encoding.
I checked that the encoding was correct on the saved file.
The file is correctly loaded if I just “load data” with the url from the server.
It is converted incorrectly if I load it using “open file / load data” from the PC.
Is there a way to dictate the type of encoding to be implemented on the “open data” puzzle? Otherwise I will solve by writing a JS routine in place of this puzzle.
Thank you!Franco
2022-03-23 at 10:22 am #50542Yuri KovelenovStaff2022-03-23 at 11:13 am #50549fsgueglCustomerI probably expressed myself badly.
I have attached a zip file to you which contains:
confronto1.jpg:
image where you can see the text being entered and the text as it
appears after reloading it with “open file” puzzle.confronto2.jpg
where you can see how the text looks after loading in the
inspection where I put 2 “print to console” containing exactly all
the uploaded file and where you can see that the characters are
not encoded correctly.FILE_SAVED.ETB
It is the file where all the data is saved and it is the same one
that was loaded in the example I showed you. You will notice that
the characters are correct and that the format is UTF8Attachments:
You must be logged in to view attached files.2022-03-29 at 5:26 pm #50712fsgueglCustomerHi Yuri,
did you have some time to look at what I sent you?
2022-04-11 at 7:35 am #50995fsgueglCustomerResolved,
I used JS to write a simple alternative routine to “openfile”, “loaded data” and “send data”; these returned the content with an incorrect charset.
-
AuthorPosts
- You must be logged in to reply to this topic.