Em 16/12/08, ricardo lopes<ricardo.lopes1...@gmail.com> escreveu:
>
> Olá pessoal, mais uma vez pesso a ajuda de vocês.
>
> Instalei um servidor Centos 5.2 com Apache e Postgresql e nele rodara um
> sistema de gerenciamento de uma empresa.
>
> Acontece que a maioria das tabelas estão rodando bem, porém duas me aparece
> o seguinte erro na tela da interface do sistema:
>
> Erro ao acessar o banco de dados
> ERRO: sequência de bytes inválida para codificação "UTF8": 0xe36f27
> 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".
> SelectLimit(SELECT a.pedido as a_pedido, a.dataemissao as a_dataemissao,
> a.valorvendas as a_valorvendas, a.valordescontos as a_valordescontos,
> a.valorfrete as a_valorfrete, a.valorpedido as a_valorpedido, a.status as
> a_status, case when a.entregue='S' then 'Sim' else 'Não' end as entregue,
> a.loja as a_loja, a.cliente as a_cliente, b.razaosocial as b_razaosocial,
> c.nome as c_nome from public.pedidos a INNER JOIN public.clientes b ON
> a.cliente = b.codigo LEFT OUTER JOIN public.vendedores c ON a.vendedor =
> c.codigo where a.loja in (1,3,2) order by a.pedido desc, 20, 0)
>
> Nas demais esta tudo ok.
>
> Alguém tem uma luz sobre esse assunto?
>
> Já para adiantar segue algumas linhas do meu postgresql.conf
>
> client_encoding = sql_ascii

NUNCA use encoding sql_ascii.
Isto siginifica não fazer nenhuma verificação/conversão dos conjuntos
de caracteres utilizados.
Especifique o encoding utilizado pelos clientes ou no postgresql.conf
ou através de um SET para a sessão.


>
> lc_messages = 'pt_BR.UTF-8'
>
> lc_monetary = 'pt_BR.UTF-8'
>
> lc_numeric = 'pt_BR.UTF-8'
>
> lc_time = 'pt_BR.UTF-8'
>


http://www.postgresql.org/docs/current/interactive/multibyte.html#MULTIBYTE-CHARSET-SUPPORTED
"The SQL_ASCII setting behaves considerably differently from the other
settings. When the server character set is SQL_ASCII, the server
interprets byte values 0-127 according to the ASCII standard, while
byte values 128-255 are taken as uninterpreted characters. No encoding
conversion will be done when the setting is SQL_ASCII. Thus, this
setting is not so much a declaration that a specific encoding is in
use, as a declaration of ignorance about the encoding. In most cases,
if you are working with any non-ASCII data, it is unwise to use the
SQL_ASCII setting, because PostgreSQL will be unable to help you by
converting or validating non-ASCII characters."

Osvaldo
_______________________________________________
pgbr-geral mailing list
pgbr-geral@listas.postgresql.org.br
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a