Managing the code page of published content
When a user publishes Component Presentations and Pages, code page values for these items are included. These values are initially set in the Publication Target in the Default Code Page setting. You can override this setting in your Template. You can also map the code page to a Java character set name.
- Setting the Default Code Page
- By default, the Default Code Page is set to System Default, the code page specified by the Windows operating system of the machine from which you are publishing. However, if you publish from a Content Manager with one code page (using that source code page) to a Presentation Server whose Web server uses a different code page, you may lose characters in publishing. In such situations, set the Default Code Page to the code page of the Web server(s) to which you are publishing.
- Setting the code page of your publishable content
-
If you do not use the System Default, you must set the code page of your publishable content in your templates or globally in your web.config to ensure that Web browsers correctly interpret content rendered.
- To set the code page of your publishable content in your Page Templates and Component Templates, to ensure that your templates produce the following line at the top of the publishable piece of content you generate (to Page Templates before any
<html>tags):<%@page pageEncoding="UTF-8" %>where
UTF-8sets the code page to UTF-8. Set the value ofpageEncodingto the value you intend to use. - To set the code page of your publishable content globally in your web.config file, open the file in a text editor and in the
<configuration><system.web>subsection configure:<globalization fileEncoding="UTF-8" requestEncoding="UTF-8" responseEncoding="UTF-8" />
- To set the code page of your publishable content in your Page Templates and Component Templates, to ensure that your templates produce the following line at the top of the publishable piece of content you generate (to Page Templates before any
- Mapping the code page of published content to a Java character set name
- When the Content Deployer retrieves the published Component Presentations and Pages, it translates the character encodings it finds into Java character set names using a mapping file that is located in the Content Broker JAR file. This mapping file contains most commonly used code pages. If this mapping file does not include the code page you are using, or if it maps your code page to the wrong Java character set name, you can add a custom mapping file.