Question

I've to use CakePhp with ingres.

The problem is that I've to use UTF-8 in the website and the database is provided in ISO-8859-1.

So my question is, how to manage this charset problem?

On MySql I know I can run a "SET NAMES UTF-8" request on the database, but I can't find how to do this with ingres?

Thank you very much!

Was it helpful?

Solution

Unfortunately the encoding/character set is defined at a system level using the environment variable II_CHARSETxx. See the output from ingprenv to get your value. You can change it but you are likely to get data corruption. Your best bet to work with UTF-8 is to use N(VAR)CHAR, instead of VARCHAR and the PHP driver will assume that all data coming in is in in UTF-8 and convert to-from UTF-16. This conversion is controlled by the ini setting ingres.utf8 (see http://php.net/manual/en/ingres.configuration.php#ini.ingres.utf8)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top