CakeDC / cakephp-oracle-driver

CakePHP 3 Driver for Oracle Database
Other
40 stars 24 forks source link

Can't use latin characters #17

Closed hugolizama closed 7 years ago

hugolizama commented 7 years ago

Hi, i have spanish or latin characters store in the database such as "áéíóú" but when i make a get query word return without the accent marks "aeiou".

this is my connection

'default' => [
    'className' => 'CakeDC\OracleDriver\Database\OracleConnection',
    'driver' => 'CakeDC\OracleDriver\Database\Driver\OracleOCI',
    'persistent' => false,
    'host' => '127.0.0.1',            
    'username' => 'user',
    'password' => 'pass',
    'database' => 'orcl',
    'encoding' => 'utf8',            
    'timezone' => 'UTC',
    'flags' => ['charset' => 'AL32UTF8'],
    'cacheMetadata' => true,
    'log' => false,
    'quoteIdentifiers' => false,
    'url' => env('DATABASE_URL', null),
]

I've tried to set NLS_LANGUAGE='LATIN AMERICAN SPANISH' NLS_TERRITORY='AMERICA' in the ALTER SESSION of the OracleBase.php file too.

any help?

skie commented 7 years ago

I would recoment to check how define nls_lang for database and for session for example here http://dba-oracle.com/bk_alter_session_set_nls_language.htm

Overload "alter session in OracleBase in $config['init'] is correct way to go.

hugolizama commented 7 years ago

Hi, after review the plugin code with more patience and the issues section i found it was related to this $options in OCI8Connection can't work because typo. I was using the first release which has the typo and the flags parameters was not being received.

Thanks for making the plugin by the way, works great!!