How do I handle characters from other spoken languages

0 favourites
  • 11 posts
From the Asset Store
120 Epic Fire FX Animations + 2 Bonus Characters. Contains 3000+ frames and a lot of Pixel Art Sprites
  • Hi

    I have been working on a personal project for myself to help me with learning French at the moment, when I copied a series of text data straight into the list properties within Construct 2 , the text displayed correct in French even when some of the letters had the various "accents" on them

    Howver I have just spent some time reading in a text file using ajax and formating the separaters etc but when I feed the text data into a Text Label (Not an edit Text box) the "accents" show up as a diamond character. Does this mean that ajax is unable to handle these types of characters?

  • Hi,

    I think the problem comes from the bad character encoding in your web page (the html document). Try using this :

    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

    If needed, modify the html file with a text editor such as Notepad++ or SublimeText and select "UTF8 without BOM" to make it work.

    If this is not the solution, I really don't know how to help you ^^'

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hi,

    I think the problem comes from the bad character encoding in your web page (the html document). Try using this :

    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

    If needed, modify the html file with a text editor such as Notepad++ or SublimeText and select "UTF8 without BOM" to make it work.

    If this is not the solution, I really don't know how to help you ^^'

    Ratmaster thank you for your repy, where would I add this within the project files as when I build this project for Android and run it on an Android device it does the same thing. I am using phonegap to build this if that makes any difference.

  • When exporting your project, you get a "www" folder, and in it you will find the "index.html" file

    When you open it with a text editor such as SublimText, you will see the line "<meta charset="UTF-8" />" which is equivalent to what I wrote before (but you can still try to replace it, it might maybe help on some browser)

    It seems Construct2 already encoded the file in UTF-8, so it's more probable there is a problem with the encoding of the text file you read with ajax, so you should try saving it with another encoding

    In sublimText2, you use "File > Save with encoding" and you select your encoding (here UTF-8) It might mess up every accent in your document though, but it's the only way. (this software exists in a trial version you could use if needed)

    I'm not an expert but I'm pretty sure the problem comes either from the fact that the web page's encoding is wrong and can't display the characters correctly, either from the fact that you try to load text from a file with ANOTHER encoding and the characters are not converted properly ^^' To avoid this kind of problem, you should always use the same character encoding in every file

  • When exporting your project, you get a "www" folder, and in it you will find the "index.html" file

    When you open it with a text editor such as SublimText, you will see the line "<meta charset="UTF-8" />" which is equivalent to what I wrote before (but you can still try to replace it, it might maybe help on some browser)

    It seems Construct2 already encoded the file in UTF-8, so it's more probable there is a problem with the encoding of the text file you read with ajax, so you should try saving it with another encoding

    In sublimText2, you use "File > Save with encoding" and you select your encoding (here UTF-8) It might mess up every accent in your document though, but it's the only way. (this software exists in a trial version you could use if needed)

    I'm not an expert but I'm pretty sure the problem comes either from the fact that the web page's encoding is wrong and can't display the characters correctly, either from the fact that you try to load text from a file with ANOTHER encoding and the characters are not converted properly ^^' To avoid this kind of problem, you should always use the same character encoding in every file

    Ratmaster

    I firstly tried your inital suggestion with adding the html tag to the index.html with and without the existin meta tag line created by Construct 2 but that did not work.

    On your second suggestion, are you refering to editting the file that containts the text data that has the language held in it? If so I will copy it first and try SublimText2 , also is this the only type of editor , as in is there a free one, that could do this?

  • Yes, I'm talking about editing the file that contains the text data It's a good idea to make a copy first

    You could also use Notepad++ which is entirely free, I mostly use SublimeText out of habit ^^

  • Yes, I'm talking about editing the file that contains the text data It's a good idea to make a copy first

    You could also use Notepad++ which is entirely free, I mostly use SublimeText out of habit ^^

    Ratmaster - That worked using notepad++ by converting the file to UTF-8 saving it and then zipping up the folder to load into phonegap once built and installed, the French "accents" (I am sure you will correct me on that terminology ) are now showing.

    Thank you for this RatMaster, it is just a case of remembering this when exporting the project next time if I add to this file or any other of these.

    Now to continue with this project which has become quite a challenge

  • I'm really glad I could help you I had a similar problem in the past so I figured it could be the same for you ^^

    No need to correct you, it's indeed called "accents" in French

  • I'm really glad I could help you I had a similar problem in the past so I figured it could be the same for you ^^

    No need to correct you, it's indeed called "accents" in French

    Odd thing has happened here and I am wondering if it is to do with phonegap as it played up with the TTS plugin I have were it would not compile with it added in, however when I removed it and re-added it that worked.

    However, with this Unicode file I have converted, I copied it to another folder, did some more additions to the project, exported the project, copied the convertered txt file into and overwritting the newly exported one, zipped it up, loaded it into phonegap (update code) re-built it installed but the characters are not showing correctly .

    Maybe I have to re-convert the exported one everytime?

    ** EDIT ** yes is the answer to the above question

  • yes that's the boring part if the software doesn't keep it :-/

  • EDIT : My bad, after re-reading carefully your conversation, I understood the matter. Thanks, it was very useful to me .

    Hello guys, it seems that I'm having the same issue. I store all of my text in a JSON file, french letters such as é or à would be diamonds, except that I am using NW.js builds... any suggestion to fix that ?

    I guess there is some tweaking too, but where could I find it :O

    Thanks

    Thomas

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)