Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Claushingebjerg 939 posts 2574 karma points
    Dec 15, 2015 @ 15:52
    Claushingebjerg
    0

    Bad encoding on characters from json

    Im using the json checkbox, but having trouble with danish characters getting "mangled" somewhere between the json and the umbraco ui...

    My code:

    enter image description here

    The json enter image description here The UI

    enter image description here

    Is this a bug, or how can i avoid it?

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Dec 15, 2015 @ 16:47
    Chriztian Steinmeier
    0

    Hi Claus,

    Dang! That looks like the good old "typed and saved as UTF-8 but being displayed by a webpage that claims ISO-8859-1" encoding problem...

    If you're not using the Custom Labels feature, you probably have to take a look at the source to check if somewhere in the pipeline, someone's taking a shortcut, encoding-wise :-)

    /Chriztian

  • Claushingebjerg 939 posts 2574 karma points
    Dec 16, 2015 @ 07:25
    Claushingebjerg
    0

    The strange thing is if i copy the generated json and put it in a static text file, and use that as a source, it works fine. So one would have the suspicion, that its the encoding of the view... Can i force that to be utf-8 encoded?

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Dec 16, 2015 @ 08:00
    Chriztian Steinmeier
    0

    You should be able to, yes - most texteditors give you the option when saving as UTF-8, to include the Byte Order Mark (BOM - a couple of bytes that start the file) - e.g., in TextMate I get this dialog:

    enter image description here

    I've fixed some issues with Masterpages that way before, so probably works...

    /Chriztian

Please Sign in or register to post replies

Write your reply to:

Draft