Module: Hpricot

Defined in:
lib/common/http/fix_hpricot.rb,
lib/common/http/fix_hpricot.rb

Overview

尝试fix Hpricot在解析xpath的时候 对带冒号的字符串匹配有问题可能会存在引入新bug的风险,对Hpricot的解析方式没有完全搞懂

Defined Under Namespace

Modules: Traverse

Class Method Summary collapse

Class Method Details

.uxs(str) ⇒ Object

:nodoc:



12
13
14
15
16
# File 'lib/common/http/fix_hpricot.rb', line 12

def self.uxs(str)
    str.to_s.force_encoding("gbk")
    #gsub(/\&(\w+);/){ [NamedCharacters[$1] || ??].pack("U*") }
    #gsub(/\&\#(\d+);/){ [$1.to_i].pack("U*").encode("gbk") }.force_encoding("gbk")
end