Actions
Defect #10590
closedWikiContent::Version#text return string with #<Encoding:ASCII-8BIT> when uncompressed
Defect #10590:
WikiContent::Version#text return string with #<Encoding:ASCII-8BIT> when uncompressed
Resolution:
Fixed
Affected version:
Description
- ruby 1.9.3p125
- postgresql 8.4.11
- rails 2.3.14
- redmine trunk
Wiki history compression: none
$ script/console Loading development environment (Rails 2.3.14) /home/asor/.rvm/gems/ruby-1.9.3-p125-fast/gems/activesupport-2.3.14/lib/active_support/inflector.rb:3:in `<top (required)>': iconv will be deprecated in the future, use String#encode instead. NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01. Gem.source_index called from /home/asor/.rvm/gems/ruby-1.9.3-p125-fast/gems/rails-2.3.14/lib/rails/gem_dependency.rb:21. >> WikiPage.find(:first).content.text.encoding => #<Encoding:UTF-8> >> WikiPage.find(:first).content.versions.first.text.encoding => #<Encoding:ASCII-8BIT>
We should always force_encoding to UTF-8, if data stored as binary type.
The patch attached.
When applied:
Files
Actions