0

I'm using DBIx::Class to fetch data from Oracle (11.2). when the data fetched, for example "Alfred Kärcher" its returns the value as "Alfred Karcher". I tried to add the $ENV NLS_LANG and NLS_NCHAR but still no change.

I also used the utf8 module to verify that the data is utf8 encoded.

Miller
  • 34,962
  • 4
  • 39
  • 60
loudstil
  • 51
  • 5
  • Have a look to https://metacpan.org/pod/DBD::Oracle#ora_charset-ora_ncharset and https://metacpan.org/pod/DBD::Oracle#UNICODE, that might be useful. – DavidEG Jul 02 '14 at 15:31

2 Answers2

0

This looks like the Oracle client library converting the data.

Make sure the database encoding is set to AL32UTF8 and the environment variable NLS_LANG to AMERICAN_AMERICA.AL32UTF8.

It might also be possible by setting the ora_(n)charset parameter instead.

The two links from DavidEG contain all the info that's needed to make it work.

You don't need use utf8; in your script but make sure you set STDOUT to UTF-8 encoding: use encoding 'utf8';

Alexander Hartmaier
  • 2,178
  • 12
  • 21
0

here the problem is with the column data type that you specified for the storing

you column database specified as VARCHAR2(10), then for oracle, actually stores the 10 bytes, for English 10 bytes means 10 characters, but in case the data you insert into the column contains some special characters like umlaut, it require 2 bytes. then you end up RA-12899: VALUE too large FOR column. so in case the data that you inserting into the column which is provided the user and from different countries then use VARCHAR2(10 char)

In bytes: VARCHAR2(10 byte). This will support up to 10 bytes of data, which could be as few as two characters in a multi-byte character sets.

In characters: VARCHAR2(10 char). This will support to up 10 characters of data, which could be as much as 40 bytes of information.

Ankireddy Polu
  • 1,824
  • 16
  • 16