Convert a letter into something else?

0 favourites
  • 12 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hi. I'm working on KlangMs localization system, and I'm noticing how loading .txt and .csv files corrupts certain letters like the ÆØÅ from the Norwegian alphabet. Even if I've verified they look correct in any text editor, it shows up as corrupted.

    Here's two images showing the problem:

    However writing these letters from construct works fine. So I'm wondering if there's any way to find these corrupt letters with some expression, and then replace it with a letter called upon within the editor like I'm showing in the second image?

    Thanks!

  • Hi. I'm working on KlangMs localization system, and I'm noticing how loading .txt and .csv files corrupts certain letters like the ÆØÅ from the Norwegian alphabet. Even if I've verified they look correct in any text editor, it shows up as corrupted.

    Here's two images showing the problem:

    However writing these letters from construct works fine. So I'm wondering if there's any way to find these corrupt letters with some expression, and then replace it with a letter called upon within the editor like I'm showing in the second image?

    Thanks!

    The Only way I know is like this.

    A link to encoding

    http://codebeautify.org/url-encode-string

    or

    http://www.w3schools.com/tags/ref_urlencode.asp

    I don't know if it works with .csv, but works with .txt files

  • Tinimations

    Be sure that you saved your text in utf-8 not in ascii. If this doesn't work you can additional try to override the MIME type:

    text/plain; charset=utf-8

    There is an override action in the ajax-plugin

  • sizcoz Hmm couldn't get it to work. Changing the å into what the encoder suggested only made it print the encoded text to screen. It didn't convert into anything.

    Asmodean I tried both overriding and saving the text as UTF-8, however now the exported .csv now shows the "å" as "?" in the text file... No luck. A find and replace expression within Construct would fix this though.

  • sizcoz Hmm couldn't get it to work. Changing the å into what the encoder suggested only made it print the encoded text to screen. It didn't convert into anything.

    Asmodean I tried both overriding and saving the text as UTF-8, however now the exported .csv now shows the "å" as "?" in the text file... No luck. A find and replace expression within Construct would fix this though.

    Tinimations

    http://www.sizzle-games.com/norwegian.capx

    Works here chrome, firefox, edge, also works on android

  • I tried both overriding and saving the text as UTF-8, however now the exported .csv now shows the "å" as "?" in the text file... No luck. A find and replace expression within Construct would fix this though.

    try to override with:

    text/csv; charset=utf-8

    not with text/plain

    If this doesn't work you could to it the other way around and save the text as ascii and override the mime type with:

    text/csv; charset=ascii

    I still think that is a character encoding problem.

  • sizcoz Oh I see what I did wrong. It worked now. Thank you!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • sizcoz Oh I see what I did wrong. It worked now. Thank you!

    Tinimations

    There is probably a better alternative.

    You could use "a" instead of "å" in your text file then replace all the "a"'s with "å"'s

    code.

    Text: Set Text to RegexReplace(text.Text,"a","g","å")

    That will do it !

  • Well a is a very common letter in Norwegian as well so no I can't do that. What I'll rather do is I'll replace all "å" in the exported csv with the code with a find and replace feature before I import it into construct. It worked. Thanks for the tip though.

  • Well a is a very common letter in Norwegian as well so no I can't do that. What I'll rather do is I'll replace all "å" in the exported csv with the code with a find and replace feature before I import it into construct. It worked. Thanks for the tip though.

    No probs, notepad++ is good for that, and free.

  • Well a is a very common letter in Norwegian as well so no I can't do that. What I'll rather do is I'll replace all "å" in the exported csv with the code with a find and replace feature before I import it into construct. It worked. Thanks for the tip though.

    Tinimations

    This will save you a lot of time.....Convert the whole file with notepad++

    Go into notepad ++, select all text..

    Then do this...

    Hope this helps

  • sizcoz Aww yiss! This should help me get all the languages in! Thanks dude.

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