agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
ERROR:  invalid byte sequence for encoding "UTF8": 0x92
7+ messages / 6 participants
[nested] [flat]

* ERROR:  invalid byte sequence for encoding "UTF8": 0x92
@ 2007-03-20 19:34  Karthikeyan Sundaram <skarthi98@hotmail.com>
  0 siblings, 2 replies; 7+ messages in thread

From: Karthikeyan Sundaram @ 2007-03-20 19:34 UTC (permalink / raw)
  To: pgsql-admin@postgresql.org; pgsql-sql

Hi,

   I am using postgres 8.2.3.  I have recently converted my database from 
sql-ascii to UTF8.  I have a portal which calls a perl program to insert the 
data into the database.

    While inserting, I am getting an error message

DBD::Pg::st execute failed: ERROR:  invalid byte sequence for encoding 
"UTF8": 0x92
[for Statement "INSERT INTO longdescs (bug_id, who, bug_when, thetext, 
isprivate)


How can I set the client encoding in perl. Can somebody help me?

Regards
skarthi

_________________________________________________________________
Get a FREE Web site, company branded e-mail and more from Microsoft Office 
Live! http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: ERROR:  invalid byte sequence for encoding "UTF8": 0x92
@ 2007-03-20 20:03  Ivo Rossacher <rossacher@bluewin.ch>
  parent: Karthikeyan Sundaram <skarthi98@hotmail.com>
  1 sibling, 0 replies; 7+ messages in thread

From: Ivo Rossacher @ 2007-03-20 20:03 UTC (permalink / raw)
  To: pgsql-admin@postgresql.org

Am Dienstag, 20. März 2007 20:34 schrieb Karthikeyan Sundaram:
> Hi,
>
>    I am using postgres 8.2.3.  I have recently converted my database from
> sql-ascii to UTF8.  I have a portal which calls a perl program to insert
> the data into the database.
>
>     While inserting, I am getting an error message
>
> DBD::Pg::st execute failed: ERROR:  invalid byte sequence for encoding
> "UTF8": 0x92
> [for Statement "INSERT INTO longdescs (bug_id, who, bug_when, thetext,
> isprivate)
>
>
> How can I set the client encoding in perl. Can somebody help me?
>
> Regards
> skarthi

After the connection is done send set client_encoding  to '<Encoding Perl is 
using>' to the server. The server then will convert the strings back and 
forward for you.
Se manual chapter 21.2 Character Set Support for more details.

Best regards
Ivo
>
> _________________________________________________________________
> Get a FREE Web site, company branded e-mail and more from Microsoft Office
> Live! http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: You can help support the PostgreSQL project by donating at
>
>                 http://www.postgresql.org/about/donate



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: [SQL] ERROR: invalid byte sequence for encoding "UTF8": 0x92
@ 2007-03-20 20:06  Claus Guttesen <kometen@gmail.com>
  parent: Karthikeyan Sundaram <skarthi98@hotmail.com>
  1 sibling, 1 reply; 7+ messages in thread

From: Claus Guttesen @ 2007-03-20 20:06 UTC (permalink / raw)
  To: Karthikeyan Sundaram <skarthi98@hotmail.com>; +Cc: pgsql-admin@postgresql.org; pgsql-sql

>    I am using postgres 8.2.3.  I have recently converted my database from
> sql-ascii to UTF8.  I have a portal which calls a perl program to insert the
> data into the database.
>
>     While inserting, I am getting an error message
>
> DBD::Pg::st execute failed: ERROR:  invalid byte sequence for encoding
> "UTF8": 0x92
> [for Statement "INSERT INTO longdescs (bug_id, who, bug_when, thetext,
> isprivate)

Try to modify client_encoding in postgresql.conf to utf8 and restart your db.

regards
Claus



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: [SQL] ERROR: invalid byte sequence for encoding "UTF8": 0x92
@ 2007-03-21 03:32  Michael Fuhr <mike@fuhr.org>
  parent: Claus Guttesen <kometen@gmail.com>
  0 siblings, 0 replies; 7+ messages in thread

From: Michael Fuhr @ 2007-03-21 03:32 UTC (permalink / raw)
  To: Claus Guttesen <kometen@gmail.com>; +Cc: Karthikeyan Sundaram <skarthi98@hotmail.com>; pgsql-admin@postgresql.org; pgsql-sql

On Tue, Mar 20, 2007 at 09:06:25PM +0100, Claus Guttesen wrote:
> >DBD::Pg::st execute failed: ERROR:  invalid byte sequence for encoding
> >"UTF8": 0x92
> >[for Statement "INSERT INTO longdescs (bug_id, who, bug_when, thetext,
> >isprivate)
> 
> Try to modify client_encoding in postgresql.conf to utf8 and restart your 
> db.

The data is apparently not UTF-8 so client_encoding needs to be set
to something else.  0x92 is a hint that the encoding might be
Windows-1252 or Windows-1250 since that byte represents the right
single quotation mark in those encodings; that's a common character
in data that originated in Windows.  Also, client_encoding can be set
by the client without having to restart the backend.

-- 
Michael Fuhr



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* ERROR:  invalid byte sequence for encoding "UTF8": 0xe9 0x6d 0x61
@ 2017-10-10 13:28  ROS Didier <didier.ros@edf.fr>
  0 siblings, 1 reply; 7+ messages in thread

From: ROS Didier @ 2017-10-10 13:28 UTC (permalink / raw)
  To: pgsql-sql

Hi
               The following function does not work anymore in PostgreSQL 9.6 (it worked in 9.3) :

>>
CREATE OR REPLACE FUNCTION fonction_verif_droits (pmodulename varchar(32), prolename varchar(15)) RETURNS boolean
AS $$
DECLARE is_exists BOOLEAN;
BEGIN
    -- Securisation du search_path: les schémas de confiance, puis 'pg_temp'.
    PERFORMpg_catalog.set_config('search_path', public,pg_temp', true);
    SELECT a.droit_acces INTO is_exists FROM gestion_droits a WHERE a.rolename=prolename AND a.module=pmodulename ;
    IF NOT FOUND THEN
        RETURN false;
    END IF;
    RETURN is_exists;
END
$$ LANGUAGE plpgsql SECURITY DEFINER;
<<
The error message is :
ERROR:  invalid byte sequence for encoding "UTF8": 0xe9 0x6d 0x61

Have you any idea where the problem comes from ?

Thanks in advance

Best regards

[cid:image001.png@01D341DC.7C0EED80]
Didier ROS
DSP/CSP IT-DMA/Solutions Groupe EDF/Expertise Applicative
Expertise SGBD
32 Avenue Pablo Picasso
92000 NANTERRE
Bureau : E2 565D (aile Nord-Est)
Tél. : 01.78.66.61.14
Tél. mobile : 06.49.51.11.88
Fax : 01.78.66.93.47
Mail : didier.ros@edf.fr
Mail du support : support-oracle-niveau3@edf.fr<mailto:support-oracle-niveau3@edf.fr>
Mail du support : support-postgres-niveau3@edf.fr<mailto:%20support-postgres-niveau3@edf.fr>
Site du support : https://sissi.edf.fr/web/expertise-sgbd/accueil




Ce message et toutes les pièces jointes (ci-après le 'Message') sont établis à l'intention exclusive des destinataires et les informations qui y figurent sont strictement confidentielles. Toute utilisation de ce Message non conforme à sa destination, toute diffusion ou toute publication totale ou partielle, est interdite sauf autorisation expresse.

Si vous n'êtes pas le destinataire de ce Message, il vous est interdit de le copier, de le faire suivre, de le divulguer ou d'en utiliser tout ou partie. Si vous avez reçu ce Message par erreur, merci de le supprimer de votre système, ainsi que toutes ses copies, et de n'en garder aucune trace sur quelque support que ce soit. Nous vous remercions également d'en avertir immédiatement l'expéditeur par retour du message.

Il est impossible de garantir que les communications par messagerie électronique arrivent en temps utile, sont sécurisées ou dénuées de toute erreur ou virus.
____________________________________________________

This message and any attachments (the 'Message') are intended solely for the addressees. The information contained in this Message is confidential. Any use of information contained in this Message not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval.

If you are not the addressee, you may not copy, forward, disclose or use any part of it. If you have received this message in error, please delete it and all copies from your system and notify the sender immediately by return message.

E-mail communication cannot be guaranteed to be timely secure, error or virus-free.

Attachments:

  [image/png] image001.png (5.5K, ../../c9879a8bd95c4bf0b63d672e7921fed9@PCYINTPEXMU001.NEOPROD.EDF.FR/3-image001.png)
  download | view image

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: ERROR: invalid byte sequence for encoding "UTF8": 0xe9 0x6d 0x61
@ 2017-10-11 06:20  Feike Steenbergen <feikesteenbergen@gmail.com>
  parent: ROS Didier <didier.ros@edf.fr>
  0 siblings, 0 replies; 7+ messages in thread

From: Feike Steenbergen @ 2017-10-11 06:20 UTC (permalink / raw)
  To: ROS Didier <didier.ros@edf.fr>; +Cc: pgsql-sql

On 10 October 2017 at 15:28, ROS Didier <didier.ros@edf.fr> wrote:
>     -- Securisation du search_path: les schémas de confiance, puis
> The error message is :
>
> ERROR:  invalid byte sequence for encoding "UTF8": 0xe9 0x6d 0x61

I'm guessing your client is actually using an encoding of something like
LATIN1, but is identifying itself as UTF8.

The sequence 0xe9 0x6d 0x61 in LATIN1 is "éma", which matches your line
with 'les schémas'.
However, 0xe9 is invalid in UTF8.

To validate this, you could do the following:

select current_setting('client_encoding');
set client_encoding to 'LATIN1';
select current_setting('client_encoding');

before executing your command.


By the way, did you know you can set configuration parameters per function
on a different way as well:

CREATE OR REPLACE FUNCTION abc()
RETURNS boolean
LANGUAGE SQL AS $$
SELECT true;
$$
SET search_path TO 'public, pg_temp';

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: ERROR: invalid byte sequence for encoding "UTF8": 0xe9 0x6d 0x61 - fixed
@ 2017-10-11 07:49  ROS Didier <didier.ros@edf.fr>
  0 siblings, 0 replies; 7+ messages in thread

From: ROS Didier @ 2017-10-11 07:49 UTC (permalink / raw)
  To: feikesteenbergen@gmail.com <feikesteenbergen@gmail.com>; +Cc: pgsql-sql

Hi
<<
select current_setting('client_encoding');
set client_encoding to 'LATIN1';
select current_setting('client_encoding');
before executing your command.
>>

Thanks you very much. It works great.

Best regards
[cid:image001.png@01D34276.389CF160]
Didier ROS
DSP/CSP IT-DMA/Solutions Groupe EDF/Expertise Applicative
Expertise SGBD
32 Avenue Pablo Picasso
92000 NANTERRE
Bureau : E2 565D (aile Nord-Est)
Tél. : 01.78.66.61.14
Tél. mobile : 06.49.51.11.88
Fax : 01.78.66.93.47
Mail : didier.ros@edf.fr
Mail du support : support-oracle-niveau3@edf.fr<mailto:support-oracle-niveau3@edf.fr>
Mail du support : support-postgres-niveau3@edf.fr<mailto:%20support-postgres-niveau3@edf.fr>
Site du support : https://sissi.edf.fr/web/expertise-sgbd/accueil

De : feikesteenbergen@gmail.com [mailto:feikesteenbergen@gmail.com]
Envoyé : mercredi 11 octobre 2017 08:21
À : ROS Didier <didier.ros@edf.fr>
Cc : pgsql-sql@postgresql.org
Objet : Re: [SQL] ERROR: invalid byte sequence for encoding "UTF8": 0xe9 0x6d 0x61



On 10 October 2017 at 15:28, ROS Didier <didier.ros@edf.fr<mailto:didier.ros@edf.fr>> wrote:
>     -- Securisation du search_path: les schémas de confiance, puis
> The error message is :
>
> ERROR:  invalid byte sequence for encoding "UTF8": 0xe9 0x6d 0x61

I'm guessing your client is actually using an encoding of something like LATIN1, but is identifying itself as UTF8.

The sequence 0xe9 0x6d 0x61 in LATIN1 is "éma", which matches your line with 'les schémas'.
However, 0xe9 is invalid in UTF8.

To validate this, you could do the following:

select current_setting('client_encoding');
set client_encoding to 'LATIN1';
select current_setting('client_encoding');

before executing your command.


By the way, did you know you can set configuration parameters per function on a different way as well:

CREATE OR REPLACE FUNCTION abc()
RETURNS boolean
LANGUAGE SQL AS $$
SELECT true;
$$
SET search_path TO 'public, pg_temp';




Ce message et toutes les pièces jointes (ci-après le 'Message') sont établis à l'intention exclusive des destinataires et les informations qui y figurent sont strictement confidentielles. Toute utilisation de ce Message non conforme à sa destination, toute diffusion ou toute publication totale ou partielle, est interdite sauf autorisation expresse.

Si vous n'êtes pas le destinataire de ce Message, il vous est interdit de le copier, de le faire suivre, de le divulguer ou d'en utiliser tout ou partie. Si vous avez reçu ce Message par erreur, merci de le supprimer de votre système, ainsi que toutes ses copies, et de n'en garder aucune trace sur quelque support que ce soit. Nous vous remercions également d'en avertir immédiatement l'expéditeur par retour du message.

Il est impossible de garantir que les communications par messagerie électronique arrivent en temps utile, sont sécurisées ou dénuées de toute erreur ou virus.
____________________________________________________

This message and any attachments (the 'Message') are intended solely for the addressees. The information contained in this Message is confidential. Any use of information contained in this Message not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval.

If you are not the addressee, you may not copy, forward, disclose or use any part of it. If you have received this message in error, please delete it and all copies from your system and notify the sender immediately by return message.

E-mail communication cannot be guaranteed to be timely secure, error or virus-free.


Attachments:

  [image/png] image001.png (5.5K, ../../e4ce04b811794b98a5aa09e8c86e132b@PCYINTPEXMU001.NEOPROD.EDF.FR/3-image001.png)
  download | view image

^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2017-10-11 07:49 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-03-20 19:34 ERROR:  invalid byte sequence for encoding "UTF8": 0x92 Karthikeyan Sundaram <skarthi98@hotmail.com>
2007-03-20 20:03 ` Ivo Rossacher <rossacher@bluewin.ch>
2007-03-20 20:06 ` Re: [SQL] ERROR: invalid byte sequence for encoding "UTF8": 0x92 Claus Guttesen <kometen@gmail.com>
2007-03-21 03:32   ` Re: [SQL] ERROR: invalid byte sequence for encoding "UTF8": 0x92 Michael Fuhr <mike@fuhr.org>
2017-10-10 13:28 ERROR:  invalid byte sequence for encoding "UTF8": 0xe9 0x6d 0x61 ROS Didier <didier.ros@edf.fr>
2017-10-11 06:20 ` Re: ERROR: invalid byte sequence for encoding "UTF8": 0xe9 0x6d 0x61 Feike Steenbergen <feikesteenbergen@gmail.com>
2017-10-11 07:49 Re: ERROR: invalid byte sequence for encoding "UTF8": 0xe9 0x6d 0x61 - fixed ROS Didier <didier.ros@edf.fr>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox