LogoLogo
HomeAPIBlog
3.0.0-SNAPSHOT
3.0.0-SNAPSHOT
  • INTRODUCTION
    • Getting Started
      • Running Local Development Servers
      • Beginner Tutorial: Hello World
      • Beginner Tutorial: Hello Database
      • Tutorial: Wheels, AJAX, and You
    • Frameworks and Wheels
    • Requirements
    • Manual Installation
    • Upgrading
    • Screencasts
  • Command Line Tools
    • CLI Commands
    • wheels - commands
    • wheels generate - commands
    • wheels dbmigrate - commands
    • wheels plugins - commands
  • Working with Wheels
    • Conventions
    • Configuration and Defaults
    • Directory Structure
    • Switching Environments
    • Testing Your Application
    • Contributing to Wheels
    • Documenting your Code
  • Handling Requests with Controllers
    • Request Handling
    • Rendering Content
    • Redirecting Users
    • Sending Files
    • Sending Email
    • Responding with Multiple Formats
    • Using the Flash
    • Using Filters
    • Verification
    • Event Handlers
    • Routing
    • URL Rewriting
      • Apache
      • IIS
      • Tomcat
      • Nginx
    • Obfuscating URLs
    • Caching
    • Nesting Controllers
    • CORS Requests
  • Displaying Views to Users
    • Pages
    • Partials
    • Linking Pages
    • Layouts
    • Form Helpers and Showing Errors
    • Displaying Links for Pagination
    • Date, Media, and Text Helpers
    • Creating Custom View Helpers
    • Localization
  • Database Interaction Through Models
    • Object Relational Mapping
    • Creating Records
    • Reading Records
    • Updating Records
    • Deleting Records
    • Column Statistics
    • Dynamic Finders
    • Getting Paginated Data
    • Associations
    • Nested Properties
    • Object Validation
    • Object Callbacks
    • Calculated Properties
    • Transactions
    • Dirty Records
    • Soft Delete
    • Automatic Time Stamps
    • Database Migrations
      • Migrations in Production
    • Using Multiple Data Sources
  • Plugins
    • Installing and Using Plugins
    • Developing Plugins
    • Publishing Plugins
  • Project Documentation
    • Overview
  • External Links
    • Source Code
    • Issue Tracker
    • Sponsor Us
    • Community
Powered by GitBook
LogoLogo
On this page
  • Page Encoding Issues
  • Using cfprocessingdirective
  • Using file encoding
  • Localizing Wheels Helpers

Was this helpful?

Edit on GitHub
Export as PDF
  1. Displaying Views to Users

Localization

PreviousCreating Custom View HelpersNextObject Relational Mapping

Last updated 21 days ago

Was this helpful?

Work in progress

This chapter is still being constructed...

Page Encoding Issues

Generally speaking, if you try and add Unicode characters such as umlauts into templates, you may well come across display issues. This is easily fixable, but requires one of the following:

  • For the template.cfm file to be saved in the correct encoding for the language being displayed

  • Or use of the cfprocessingdirective tag to set pageEncoding

Using cfprocessingdirective

/app/views/main/example.cfm
<h1>Über uns</h1>
Incorrect encoding example
Incorrect encoding example

Incorrect encoding example

/app/views/main/example.cfm
<cfprocessingdirective pageEncoding="utf-8">
<h1>Über uns</h1>

Correct encoding

Likewise, umlauts in routes would need for the app/config/routes.cfm file to have the correct encoding:

app/config/routes.cfm
<cfprocessingdirective pageEncoding="utf-8">
<cfscript>
    mapper()
        .get(name="about", pattern="/über-uns", to="pages##about")
        .root(to="wheels##wheels", method="get")
    .end();
</cfscript>

Using file encoding

If you're actively trying to avoid the use of cfprocessingdirective, you can resave the template or route file with UTF-8-BOM. Your local text editor should provide this facility; here's an example in Notepad++ (windows)

Localizing Wheels Helpers

// Example using monthNames args in dateSelect() Coming soon

Correct encoding
Correct encoding