Encoding issue

52 views
Skip to first unread message

Vasilis Primudriy

unread,
Jun 22, 2016, 10:24:08 AM6/22/16
to Rose::DB::Object
Hi guys,
I have a question regarding encoding in Rose::DB. I'm currently connecting to Oracle and it uses iso-8859-1 for encoding. 
Unfortunately, whenever I pull data from the database, the special characters (French accents) come back as gibberish. I suspect that somewhere in Rose::DB the default encoding is UTF and I was wondering if there is a way for me to change that to ISO. Or maybe override a method where I would do my own encoding.

Any advice would be greatly appreciated.

Vas. 

Peter Karman

unread,
Jun 27, 2016, 4:35:02 PM6/27/16
to rose-db...@googlegroups.com
Vasilis Primudriy wrote on 6/22/16, 9:24 AM:
I do not believe that Rose::DB sets a default encoding. The Oracle DBD driver might.

If you want to coerce the RDBO column values, you can either use Encode (or its'
friends) to convert to UTF-8, or figure out the appropriate NLS_LANG env
variable setting for Oracle.

Since I like to deal exclusively in UTF-8, I typically run all strings through
Search::Tool::UTF8::to_utf8() at all my program boundaries. So no matter what
the db stores the string as, I know my code has UTF-8.

--
Peter Karman . http://peknet.com/ . pe...@peknet.com
Reply all
Reply to author
Forward
0 new messages