From 2e250384980b1a14c0ce2f5dcf2c511fc1c9c38f Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Mon, 29 Mar 2010 09:09:31 -0700 Subject: [PATCH] Revert "Try to force BINARY encoding under 1.9" This reverts commit 11ea9ab021be00313ae86095b84944824d22e837. --- lib/mustache.rb | 2 -- test/mustache_test.rb | 7 ++++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/mustache.rb b/lib/mustache.rb index 19162265..11161004 100644 --- a/lib/mustache.rb +++ b/lib/mustache.rb @@ -1,5 +1,3 @@ -Encoding.default_external = 'BINARY' if defined? Encoding - require 'mustache/template' require 'mustache/context' diff --git a/test/mustache_test.rb b/test/mustache_test.rb index 3eb03040..6850bb84 100644 --- a/test/mustache_test.rb +++ b/test/mustache_test.rb @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- $LOAD_PATH.unshift File.dirname(__FILE__) require 'helper' @@ -384,12 +385,12 @@ def test_utf8 klass.template_name = 'utf8' klass.template_path = 'test/fixtures' view = klass.new - view[:test] = "\xE4\xB8\xAD\xE6\x96\x87" + view[:test] = "中文" assert_equal <<-rendered, view.render -

\xE4\xB8\xAD\xE6\x96\x87 \xE4\xB8\xAD\xE6\x96\x87

+

中文 中文

-

\xE4\xB8\xAD\xE6\x96\x87\xE5\x8F\x88\xE6\x9D\xA5\xE5\x95\xA6

+

中文又来啦

rendered end end