Unicode string:
string = "CEO Frye \u2013 response to Capitalism discussion in Davos: Vote aggressively with your wallet against firms without social conscience."
I tried (via Is this the best way to unescape unicode escape sequences in Ruby?):
def unescape_unicode(s)
s.gsub(/\\u([\da-fA-F]{4})/) {|m| [$1].pack("H*").unpack("n*").pack("U*")}
end
unescape_unicode(string) #=> CEO Frye \u2013 response to Capitalism discussion in Davos: Vote aggressively with your wallet against firms without social conscience.
But output (to file) is still identical to input! Any help would be appreciated.
Edit:
Not using IRB, using RubyMine, and input is parsed from Twitter, hence the single "\u"
not "\\u"
Edit 2: