Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

accent

I'm trying to build a story in French, but every time I build the story, my accent a replace by strange characters.

ex:  become 

I think it's an encoding problem, but I don't know how to fix it.

My only solution now is to replace every character in the final html file...

is there an easier way to fix it?

Thank you!

Comments

  • Hmm - which system are you on, might I ask? And which browser are you playing the games in?
  • XP and windows 7
    internet explorer and chrome
  • Hurk... I can't seem to replicate this. Anyone else have this problem?

    I assume you're using Twine 1.4 or higher?
  • twine 1.4.1

    my compluter seems to decode those strange character correcly
    it's when I upload the html file to my web site that it does not work...

    the HTML code looks like this

    <div id="storeArea"><div tiddler="test" tags="" modified="201401220838" created="201401220830" twine-position="307,22" modifier="twee">\n\n\n\n\no\n\n\n[img[test 2]]</div>
    http://www.obsidia.ca/test.html

    on my computer, the HTML File looks like this: 
    <div id="storeArea"><div tiddler="test" tags="" modified="201401220838" created="201401220830" twine-position="307,22" modifier="twee">\n\n\n\n\no\n\n\n[img[test 2]]</div>

  • on my computer, if I edit the html file and replace all "" by "" and upload the file, it's ok
  • cedriss wrote:

    my compluter seems to decode those strange character correcly
    it's when I upload the html file to my web site that it does not work...


    Ah, the web server being involved explains it. The problem is in the encoding: the HTML contains Unicode characters in UTF-8, while your web server serves the HTML file using "Content-Type: text/html; charset=ISO-8859-1".

    One solution would be to use entities (&eacute; etc or numeric) for all non-ASCII characters. Probably not the best way, since Unicode characters can occur in passages, in scripts, in style sheets etc and entities might need different syntax depending on the context.

    Another solution would be to add a line like this to the <head> section of the HTML:

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    There is already this line, but it doesn't seem to do anything: (in some browsers?)

    <meta charset="utf-8">
  • thanks, I'll try it.

  • I try

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - same problem

    I also try with those to match what I have on my other pages of the site - same issue.

    <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
    <meta http-equiv="Content-Language" content="fr-ca">

    I think that the core of the problem is when I build my story the character are replace..
  • The characters are not replaced, they are encoded in a different way: UTF-8 uses different bytes to store accented characters than ISO-8859-1 does. If the file uses UTF-8 and the browser or text editor uses ISO-8859-1, you will see the wrong characters, but that doesn't mean the file is wrong, just that it is being interpreted wrong.

    If I load your HTML file from the web server directly (when it is served as ISO-8859-1), the accented characters are wrong, but if I save it to a local directory and then load it from there, it displays fine. Therefore, the way the web server sends the file (what it puts in the HTTP headers) is what triggers the problem.

    I would have thought the http-equiv header would solve it though.
  • cedriss, is your website actually Dropbox?

    I remember this on the Google group once - when Dropbox serves a file via HTTP it looks only at the first few bytes to determine the type. If the server detects HTML, it serves the HTML as ISO-8859-1 rather than reading far enough down the file to see the meta tag that would tell a regular web server to use UTF-8. Dropbox claims this is to protect the privacy of the file's contents.

    There really isn't a viable workaround except to not serve the file via Dropbox (convenient as the service is for most purposes).
  • mth wrote:

    There is already this line, but it doesn't seem to do anything: (in some browsers?)

    <meta charset="utf-8">

    This page informed me that this is the valid way of specifying a charset in HTML5.

    Anyway, I've found out that there is actually a solution: Dropbox will serve it with the correct encoding if the header files are saved with a byte-order mark, of all things. Dang!
Sign In or Register to comment.