UTF-8 Setup

From HTML5 Builder
Jump to: navigation, search

When you develop applications in certain languages, like Chinese or Japanese, you must configure HTML5 Builder to use a multi-byte character encoding system. This page will help you to set the character encoding of your application to UTF-8, which is the most common multi-byte encoding.

The character encoding for new files set to UTF-8.

Contents

Files Character Encoding

New Files

To set the default character encoding of new files to UTF-8, for example, go to Home > Options > Editor Options, and under Default settings for new files, set Text Encoding to UTF-8. Then click OK on the bottom to apply the changes.

Existing Files

The character encoding of existing files is detected automatically by the Code Editor, and used.

If you have a page in a character encoding other than UTF-8, and you want to convert it to UTF-8: right-click in the Code Editor, and go to File Format > UTF-8.
Warning: By changing the file format, you take the risk of losing information on the conversion. To see the results of the conversion process, save the file and reopen it.
The character encoding for an existing Page container set to UTF-8.

The Encoding property

Some top-level containers, such as Page (webpages) and MPage (mobile pages), have a property, Encoding, that is used to indicate the encoding used by the file. The value of this property is printed in the resulting HTML code of the page, and the user agent will usually render the page using the encoding defined here, instead of auto-detecting the character encoding of the page.

You must define this value manually. Its default value is iso-8859-1 (Western European). If, for example, you use UTF-8 to write your pages, you must also set their Encoding property to UTF-8 in order for them to be rendered properly, and pass HTML5 validation.

PHP Settings for Japanese.

PHP Setup

Main Settings

You will also need to modify PHP settings for your application to display correctly when running it from HTML5 Builder. Go to Home > Options > PHP, and set these settings:

  • Default Charset: utf-8. This is default character encoding for PHP applications.
  • Language: Language Name. Replace Language Name with the name of the language you setup for HTML5 Builder interface, for example Chinese or Japanese, as displayed in Home > Options > Environment Options > Interface Language. For information on how to change HTML5 Builder interface language, see Translations.
  • Detect Order: auto. Default character encoding detection.
  • HTTP Input: auto. Default HTTP input character encoding.
  • HTTP Output: UTF-8. Default HTTP output character encoding.
  • Internal Encoding: UTF-8. Default internal character encoding.
  • Script Encoding: auto. Scripts character encoding.
  • Substitute Character: none. Alternative character encoding for invalid characters.
  • Function Overload: 0. Whether or not to replace single-byte functions with their multi-byte equivalent.
  • Encoding Translation: On. Character encoding detection code, whether or not to enable transparent character-encoding filter code to convert internal encoding.
  • Strict Detection: Off. Whether or not strict character-encoding detection will be used.

Finally, check Set these values on php.ini. so changes are applied to your php.ini file, and click OK to apply all changes.

Watch Values Encoding

For watch values to also display properly when you debug your application:

  1. Go to Home > Options > PHP > Internal Webserver.
  2. Enable Convert watch values from UTF-8 checkbox.
  3. Click OK to save the changes.
Personal tools