Search code examples
tridion

Tridion Rich Text Field DWT   output to "?"


Rich text field value <div>&#160;</div>

output <div>?</div>

DWT:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
@@Component.Fields.Text@@
</html>

what did i miss?

thanks


Solution

  • I can't try it out now due to lack of time, but a few things come to mind:

    • What's the encoding set on your publication target?
    • Do you get the same result in Template Builder and Preview?
    • If you open the published file with a text editor like Notepad++, what does it show?

    EDIT

    In preview I get this:

    <div> </div>
    

    After publishing I get the same as you:

    <div>?</div>
    

    So I changed my publication target to use "Unicode (UTF-8)" instead of "System Default", and now when I publish I get this:

    <div> </div>
    

    I then referred to Elena's excellent 7 clues to deal with encoding, and figured out I was missing this on my web.config:

    <globalization fileEncoding="UTF-8" requestEncoding="UTF-8" responseEncoding="UTF-8"/>
    

    This still didn't do it, it was still loading this weird character in between the tags. This last clue was because the encoding was not being applied to pages with the ".html" extension. Renamed my page template to have a .aspx extension, published, pressed F5 and magic, my div now shows:

    <div> </div>
    

    EDIT 2 If you want to use the .html extension, just add this to your page's <head>:

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