I’m a beginner to Rails.
I has a problem about unicode when I tried some example code like
class SayController < ApplicationController
@files = Dir.glob(’*’)
class ApplicationController < ActionController::Base
Pick a unique cookie name to distinguish our session data from
session :session_key => ‘_HelloRails_session_id’
response.headers[“Content-Type”] = “text/html; charset=utf-8”
ActiveRecord::Base.connection.execute ‘SET NAMES utf8’
<% for file in @files %>
- <%= file %> <% end %>
When there is a directory with Chinese characters, I got wrong
characters (the are in GB18030), why it was not in UTF-8?