Encoding problems

N

Noé Alejandro

Hi all.

I have a database (sqlite) with Ansi - Latín I codepage. With a Select
statement in Ruby, the data returned are in UTF-8. E. g.:

Database: ocupación
Ruby : ocupaci\xC3\xB3n

How can I display the correct data (i. e., ocupación)?

Thanks a lot.
 
L

Luis Lavena

Hi all.

I have a database (sqlite) with Ansi - Latín I codepage. With a Select
statement in Ruby, the data returned are in UTF-8. E. g.:

Database: ocupación
Ruby    : ocupaci\xC3\xB3n

How can I display the correct data (i. e., ocupación)?

All that depends on the console encoding you're trying to output that
information to.

If is terminal on Linux/OSX, most likely is going to work as console
is UTF8

On Windows, you need the console be set the codepage to 1252, which is
not default (use chcp)
 
N

Noé Alejandro

Luis said:
Ruby � �: ocupaci\xC3\xB3n

All that depends on the console encoding you're trying to output that
information to.

If is terminal on Linux/OSX, most likely is going to work as console
is UTF8

On Windows, you need the console be set the codepage to 1252, which is
not default (use chcp)

Hi.

Im using JetBrains RubyMine IDE (windows). I put in the first line
# encoding: WINDOWS-1252

Is that enough? I run it but the problem is the same =(
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,160
Messages
2,570,889
Members
47,423
Latest member
henerygril

Latest Threads

Top