lib/helper.rb in narou-1.4.6 vs lib/helper.rb in narou-1.5.0
- old
+ new
@@ -106,10 +106,10 @@
ENTITIES = { quot: '"', amp: "&", nbsp: " ", lt: "<", gt: ">", copy: "(c)" }
#
# エンティティ復号
#
def restor_entity(str)
- result = str.dup
+ result = str.encode("UTF-16BE", "UTF-8", :invalid => :replace, :undef => :replace, :replace => "?").encode("UTF-8")
ENTITIES.each do |key, value|
result.gsub!("&#{key};", value)
end
result
end