Developer forum

Forum » Templates » CharSet always UTF-8?

CharSet always UTF-8?


Reply

Hi DW-Developers,

 

I'm trying to change the charset to iso-8859-1 enstead for UTF-8, but it apperes to have no effect at all.


From the template description:

 

Usage

    <!--@CharSet--> 
 
Summary

    Returns the encoding character set for the page. 
    
Settings

    The value comes from the Encoding field for website language.
    (Modules tab > Language > Language > Settings panel)
    Alternatively the value is based on your Dynamicweb system settings. 
   
Remarks

    This tag can be used on master templates.
    (File Manager tab > Templates folder > Master folder)
    The value should be assigned to the charset attribute of the meta tag http-equiv Content-Type.

No matter what I select for encoding its always UTF-8...! Stange!


BTW: All links containing "&" should be written as "&amp;" to meet the standard. Does any one know how to fix that little issue?

Best,
Morten


Replies

 
Reply

I received a reporting on that same issue a couple of days ago. If it's a custom solution, you can add this in your Default.aspx code behind:
 

Pageview.TemplateMaster.SetTemplateValue("CharSet", "whatever");

 
Reply
Sorensen wrote:

I received a reporting on that same issue a couple of days ago. If it's a custom solution, you can add this in your Default.aspx code behind:
 

Pageview.TemplateMaster.SetTemplateValue("CharSet", "whatever");

And if its not?

 
Nicolai Høeg Pedersen
Reply

The Charset in .NET version of Dynamicweb is always UTF-8 because of some technical issues with setting the encoding on runtime.

 

If you need to change it, it also has to be done in globalization section in web.config, and that will also go for the administration which will propably break down.

 

So in other words - its not that easy.

 

If you want to try changing the encoding runtime it can be done in global.asax:

In Application_BeginRequest event:

 

If something then

Dim app As HttpApplication = CType(sender, HttpApplication)
app.Response.ContentEncoding = System.Text.Encoding.GetEncoding("iso-8859-1")

end if

 

That should work.

 

But may I ask why it needs to be changed?

 

 
Nicolai Høeg Pedersen
Reply


Can't be changed if it is not a custom solution

 
Reply
np wrote:


Can't be changed if it is not a custom solution

Well, its not a custom solution ... And I wanted to change the charset to make a work-arround on the "&" in links issue. All links (and menu-text) are written out to the client without replacing "&" to "&amp;"... W3C cant approve that.
So I was just trying to find a solution to that problem - and tried to change the charset, because it was described in the template-manual that I was possible... ;)

Can you tell me what the charset function does if the system always encodes as UTF-8?

 

You must be logged in to post in the forum