Page Encoding Builder

 

In this topic ...

Quick Tips

Specifying Inputs

How the Builder Works

Use this builder to manager character encoding within the pages of a model. This will enable you to work with the wide variety of character sets supported by the browser. The Page encoding builder provides two important functions:

  • Output character encoding - This builder can set the output character encoding property on a set of pages

  • Encoding management  - This builder will manage all  ${Inputs} to be properly constructed when the application server's default encoding doesn't match the page encoding

 

How this Builder Works

In a model, page data is stored internally as strings of Unicode characters. These strings must be transformed into a stream of bytes for delivery to the browser. A number of character encoding schemes exist that can control this character-to-byte conversion, and each encoding scheme exhibits benefits and tradeoffs.

A typical example of an encoding issue you might encounter involves the Euro currency character. This character does not exist in the default encoding specified by HTTP (ISO-8869-1). To display this character directly in a page, use this builder to set the output character encoding to an encoding scheme that supports the Euro character. To do this you might specify as this builder's "Encoding" input the UTF-8 or Cp1252 encoding scheme.

In some situations, the encoding scheme used in the model and the one used by the application server might not match. For example, when a form is submitted, the builder uses the character encoding used in the HTML page to construct the POST data (or the URL query string in case of a GET.)  When this data arrives at the application server, the server might use a different character encoding scheme to decode the incoming form data and to build the request parameters that are the basis for the WebSphere Portlet Factory RequestInputs object that underlies the ${Inputs} syntax.  When these encoding schemes differ, form input values can become garbled.

A feature of this builder allows it to intercept the incoming request and re-encode the RequestInputs data so that it matches the page encoding used by the application server.

 

Quick Tips

  • Tip One -- Make sure the encoding schemes you choose are supported by the browsers you expect your customers to use.

 

Specifying Inputs

The Page Encoding builder takes the inputs described in the table below. For help on inputs common to many or all builders such as those in the Properties and HTML Attributes input groups, see "Using the Builder Call Editor."

Input Name Description
Name Enter a name for this builder call. The Designer displays this name in the Builder Call List.
Encoding Enter the name of the encoding scheme to use. Type this name directly into this input and be sure you have entered it correctly.

Example: ISO-8859-1   (to specify the Western Europe encoding scheme)

All Pages Enable this check box to apply the encoding specified above to all pages in the model.
Page Settings Use this input to apply page-by-page encoding to the model. For each page in the model enable/disable encoding by choosing:

  • TRUE - Apply specified encoding to this page

  • FALSE - Do not apply specified encoding. Use default encoding.

This input is available when the "All Pages" check box is disabled.

Decode Inputs Enable this check box to force request parameters to be re-encoded into the RequestInputs object.

This input is useful in situations where the page encoding does not match that used by the application server.