text - in Ruby, trying to convert those weird quotes into "regular" quotes -


I am trying to parse a text file whose strange quote is in "and" like "general quotation marks" "

I tried to do this:

  text.gsub! (" ", '' ') Text.gsub! ("" ", '' '')  

But when it is done, they still exist there and

  \ x93 and \ x94  

, so I tried to add them also with any luck:

  text.gsub! ('\\ X93 ',' '' ') text.gsub! (' \\ x94 ',' '' ')  

The problem is, when I show those strange quotes on a webpage When I try, it makes a weird diamond with a question mark mark:

It seems that:

  text =" "foo" "= & gt;" \ 342 \ 200 \ 234foo \ 342 \ 200 \ 235 "irb (main) : 002: 0> Text.gsub! ("" "'' ') = & Gt;" \ "foo \ 342 \ 200 \ 235" irb (main): 003: 0> Text.gsub! " "\" Foo \ ""  

To remove all the character code contained in it, you must use the hex editor.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -