diff options
author | rhenium <re4k@re4k.info> | 2013-06-02 18:11:39 +0900 |
---|---|---|
committer | rhenium <re4k@re4k.info> | 2013-06-02 18:11:39 +0900 |
commit | 12db5252ddf61872411712d0992fc8b2cf82fcdd (patch) | |
tree | c3515b391eddf864adf7db6f5712a7651f34347b | |
parent | 95820bfb617b4c466f908ed6d5d68bf0b3da790b (diff) | |
download | aclog-12db5252ddf61872411712d0992fc8b2cf82fcdd.tar.gz |
remove invalid UTF-8 characters
-rw-r--r-- | app/controllers/application_controller.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 085baf1..dfab86e 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -77,7 +77,8 @@ class ApplicationController < ActionController::Base response.content_type = "application/xhtml+xml" # remove invalid charactors - response.body = response.body.gsub(/[\x0-\x8\xb\xc\xe-\x1f]/, "") + u = ActiveSupport::Multibyte::Unicode + response.body = u.tidy_bytes(response.body) end end end |