Hi, I’m using geo_location Ruby gem which returns to me a hash with the
I use Ruby1.9 and UTF-8 works fine, but in this case, when the “city”
“strange” symbols the the gem gives the string encoded in ASCII-8BIT.
Alarc'n (theorically it should be "AlarcÃ³n")
I need to send this string to a server which mandates UTF-8 usage so
it as it’s fails.
I’ve tryed to convert the encoding but received an error:
=> `encode’: “\xF3” from ASCII-8BIT to UTF-8
I’ve also tryed with force_encoding:
and then, the “result” string is converted to UTF-8 (I’ve checked
result.encoding) but it’s also not valid for the server and when
printing it I
see the same as before.
I need all of this just for a simple demo, so it owuld be valid for me
delete the non valid UTF-8 chars from the result string, but I don’t
how to do it.
Any help please?