CodeIgniter - PostgreSql 编码错误
我正在将 PostgreSQL 与 CodeIgniter 一起使用,但在使此查询正常工作时遇到一些问题。错误如下:
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
关于我能做什么的一些线索?我尝试更改 PHP 文件的编码,但尚未解决问题。
一些线索?
此致,
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,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试将 PHP 编辑器的编码从实际编码(大多数情况下为 ANSI)更改为 UTF-8,然后再次保存 PHP 文件。
Try to change the encoding of your PHP editor, from actual ( in most cases ANSI ) to UTF-8, then save again the PHP files.