André
André

Reputation: 25554

CodeIgniter - PostgreSql encoding Error

I'm using PostgreSQL with CodeIgniter and I'm with some problems getting this query to work. The error is the following:

A Database Error Occurred
Error Number: 

ERROR: invalid byte sequence for encoding "UTF8": 0x8a HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".

select * from table 
where 
lower(translate(country_ad, '()!$?: ,&+-/.ŠŒŽšœžŸ¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ' , '-------------SOZsozYYuAAAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyy')) = lower('Portugal') 
and 
lower(translate(zone_ad, '()!$?: ,&+-/.ŠŒŽšœžŸ¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ' , '-------------SOZsozYYuAAAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyy')) = lower('Lisboa')

Filename: C:\xampp\htdocs\pesquisa\system\database\DB_driver.php

Line Number: 330

Some clues on what I can do? I have tried to change the encoding of the PHP files but have not corrected the problem.

Some clues?

Best Regards,

Upvotes: 1

Views: 871

Answers (1)

Massimiliano Marini
Massimiliano Marini

Reputation: 499

Try to change the encoding of your PHP editor, from actual ( in most cases ANSI ) to UTF-8, then save again the PHP files.

Upvotes: 1

Related Questions