[ECPG] Characters set, w_char & co ... - Mailing list pgsql-novice

From SC
Subject [ECPG] Characters set, w_char & co ...
Date
Msg-id 10055061.78537.1225031462456.JavaMail.www@wwinf2215
Whole thread Raw
List pgsql-novice
Hi all !

I'm wondering how charset should ba handled when using embedded C, in particular regarding to memory allocation.

I mean my database is currently using UTF-8, and I successfully inserted (by using pgAdminIII) chinese characters in it.

My question is : in my C code, lets say my table has a 'name' column (let's say VARCHAR(50)), shall I declare :

EXEC SQL BEGIN DECLARE SECTION
w_char    pg_name[50];

or char pg_name[50*4];

or char pg_name[50*2]; ?

When stating VARCHAR[X], X specifies the charactr count, right (not the byte count used for encoding) ?

I've been told about iconv() but not sure what suits the best.

An idea anyone ?

Thank you !

BR

SC

pgsql-novice by date:

Previous
From: "G. J. Walsh"
Date:
Subject: Re: combining tables
Next
From: Cliff Nieuwenhuis
Date:
Subject: Re: combining tables