diff --git a/doc-src/HAML_CHANGELOG.md b/doc-src/HAML_CHANGELOG.md index c832cae8..f65efdcc 100644 --- a/doc-src/HAML_CHANGELOG.md +++ b/doc-src/HAML_CHANGELOG.md @@ -10,6 +10,10 @@ Support for Rails 3 versions prior to beta 4 has been removed. Upgrade to Rails 3.0.0.beta4 if you haven't already. +### Minor Improvements + +* Properly process frozen strings with encoding declarations. + ## 3.0.12 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.12). diff --git a/lib/haml/util.rb b/lib/haml/util.rb index 3280b9ab..98c5308d 100644 --- a/lib/haml/util.rb +++ b/lib/haml/util.rb @@ -441,6 +441,7 @@ MSG # @raise [ArgumentError] if the document declares an unknown encoding def check_haml_encoding(str, &block) return check_encoding(str, &block) if ruby1_8? + str = str.dup if str.frozen? bom, encoding = parse_haml_magic_comment(str) if encoding; str.force_encoding(encoding)