Characters

Started by P. Broennimannabout 13 years ago4 messagesgeneral
Jump to latest
#1P. Broennimann
peter.broennimann@gmail.com

Hi there

I am using PG 9.2 and 'pg_database' shows 'en_US.UTF-8'.

I have a text 'Piqué' but this is shown in my application as 'Piqu?' so I
was wondering where the problem is?

I am using Devart's 'PostgreSQL Data Access Components' to access PG from
FreePascal.

In my FreePascal code I do use AnsiStrings and I cast the database
results/text 'UTF8ToAnsi(...)'

Thanks for a hint!

Cheers,
P.

#2JotaComm
jota.comm@gmail.com
In reply to: P. Broennimann (#1)
Re: Characters

Hello,

2013/4/10 P. Broennimann <peter.broennimann@gmail.com>

Hi there

I am using PG 9.2 and 'pg_database' shows 'en_US.UTF-8'.

I have a text 'Piqué' but this is shown in my application as 'Piqu?' so I
was wondering where the problem is?

What is the result for these commands?

SHOW client_encoding;

and

SHOW server_encoding;

I am using Devart's 'PostgreSQL Data Access Components' to access PG from
FreePascal.

In my FreePascal code I do use AnsiStrings and I cast the database
results/text 'UTF8ToAnsi(...)'

Thanks for a hint!

Cheers,
P.

Regards

--
JotaComm
http://jotacomm.wordpress.com

#3Adrian Klaver
adrian.klaver@aklaver.com
In reply to: P. Broennimann (#1)
Re: Characters

On 04/10/2013 02:53 AM, P. Broennimann wrote:

Hi there

I am using PG 9.2 and 'pg_database' shows 'en_US.UTF-8'.

I have a text 'Piqu�' but this is shown in my application as 'Piqu?' so
I was wondering where the problem is?

I am using Devart's 'PostgreSQL Data Access Components' to access PG
from FreePascal.

In my FreePascal code I do use AnsiStrings and I cast the database
results/text 'UTF8ToAnsi(...)'

Thanks for a hint!

Just guessing, but from FreePascal docs:

http://www.freepascal.org/docs-html/rtl/system/utf8toansi.html

"
Description

Utf8ToAnsi converts an utf8-encode unicode string to an ansistring. It
converts the string to a widestring and then converts the widestring to
an ansistring.

For this function to work, a widestring manager must be installed.
"

Is there a widestring manager?

http://www.freepascal.org/docs-html/rtl/system/setwidestringmanager.html

Cheers,
P.

--
Adrian Klaver
adrian.klaver@gmail.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#4P. Broennimann
peter.broennimann@gmail.com
In reply to: Adrian Klaver (#3)
Re: Characters

Hi Adrian

Thanks a lot! After spending the day checking all sorts of things you saved
my day :)

-> I just added the unit 'cwstring' and now it works.

Thanks & good day

Cheers,
Peter

----------------------
Peter Broennimann
Untergasse 11 a
CH-8476 Unterstammheim
Switzerland
----------------------

2013/4/10 Adrian Klaver <adrian.klaver@gmail.com>

Show quoted text

On 04/10/2013 02:53 AM, P. Broennimann wrote:

Hi there

I am using PG 9.2 and 'pg_database' shows 'en_US.UTF-8'.

I have a text 'Piqué' but this is shown in my application as 'Piqu?' so
I was wondering where the problem is?

I am using Devart's 'PostgreSQL Data Access Components' to access PG
from FreePascal.

In my FreePascal code I do use AnsiStrings and I cast the database
results/text 'UTF8ToAnsi(...)'

Thanks for a hint!

Just guessing, but from FreePascal docs:

http://www.freepascal.org/**docs-html/rtl/system/**utf8toansi.html&lt;http://www.freepascal.org/docs-html/rtl/system/utf8toansi.html&gt;

"
Description

Utf8ToAnsi converts an utf8-encode unicode string to an ansistring. It
converts the string to a widestring and then converts the widestring to an
ansistring.

For this function to work, a widestring manager must be installed.
"

Is there a widestring manager?

http://www.freepascal.org/**docs-html/rtl/system/**
setwidestringmanager.html<http://www.freepascal.org/docs-html/rtl/system/setwidestringmanager.html&gt;

Cheers,
P.

--
Adrian Klaver
adrian.klaver@gmail.com