is there a way to sets DBI char encoding?

Started by Patrick Hatcherabout 23 years ago3 messagesgeneral
Jump to latest
#1Patrick Hatcher
PHatcher@macys.com

Pulling data from Pg 7.3.2 via PERL DBI. For some reason, when I pull a
char field with an apostrophe, I get a strange character in place of the
apostrophe. So the sentence: Elizabeth Arden Good Night's Sleep Cream
looks like: Elizabeth Arden Good Night~Rs Sleep Cream

My database encoding is set as LATIN1. Is there a way to do this in the
DBI? I assume this is cause of my problem. If I pull the same data in
PgAdminII, it looks correct
TIA

Patrick Hatcher
Macys.Com

#2Steve Crawford
scrawford@pinpointresearch.com
In reply to: Patrick Hatcher (#1)
Re: is there a way to sets DBI char encoding?

Could it be an artifact caused by using a "not really an apostrophe"? I see
this all the time when web sites or other data is created is some Windows app
that "helps you" by changing things to "smart quotes" using characters that
don't necessarily exist or have the same representation on other platforms.

You could create a temporary table with just that record, use pg_dump to dump
just that table, and then look at the dump to see exactly what that
apostrophe is.

Cheers,
Steve

Show quoted text

On Tuesday 11 March 2003 2:31 pm, Patrick Hatcher wrote:

Pulling data from Pg 7.3.2 via PERL DBI. For some reason, when I pull a
char field with an apostrophe, I get a strange character in place of the
apostrophe. So the sentence: Elizabeth Arden Good Night's Sleep Cream
looks like: Elizabeth Arden Good Night~Rs Sleep Cream

My database encoding is set as LATIN1. Is there a way to do this in the
DBI? I assume this is cause of my problem. If I pull the same data in
PgAdminII, it looks correct
TIA

Patrick Hatcher
Macys.Com

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

#3Patrick Hatcher
PHatcher@macys.com
In reply to: Steve Crawford (#2)
Re: is there a way to sets DBI char encoding?

CRAP!!!
You are absolutly correct. I receive a data dump from a Filemaker database
and sure enough, smart quotes is checked off in one of the files.

Thanks for pointing me in the correct direction.

Patrick Hatcher
Macys.Com
Legacy Integration Developer

Steve Crawford
<scrawford@pinpointres To: "Patrick Hatcher" <PHatcher@macys.com>,
earch.com> pgsql-general@postgresql.org
cc:
03/11/2003 03:33 PM Subject: Re: [GENERAL] is there a way to sets DBI char encoding?

Could it be an artifact caused by using a "not really an apostrophe"? I see

this all the time when web sites or other data is created is some Windows
app
that "helps you" by changing things to "smart quotes" using characters that

don't necessarily exist or have the same representation on other platforms.

You could create a temporary table with just that record, use pg_dump to
dump
just that table, and then look at the dump to see exactly what that
apostrophe is.

Cheers,
Steve

Show quoted text

On Tuesday 11 March 2003 2:31 pm, Patrick Hatcher wrote:

Pulling data from Pg 7.3.2 via PERL DBI. For some reason, when I pull a
char field with an apostrophe, I get a strange character in place of the
apostrophe. So the sentence: Elizabeth Arden Good Night's Sleep Cream
looks like: Elizabeth Arden Good Night~Rs Sleep Cream

My database encoding is set as LATIN1. Is there a way to do this in the
DBI? I assume this is cause of my problem. If I pull the same data in
PgAdminII, it looks correct
TIA

Patrick Hatcher
Macys.Com

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html