[ECPG] Characters set, w_char & co ...

From: SC <robot(dot)conversion(at)wanadoo(dot)fr>
To: pgsql-novice(at)postgresql(dot)org
Subject: [ECPG] Characters set, w_char & co ...
Date: 2008-10-26 14:31:02
Message-ID: 10055061.78537.1225031462456.JavaMail.www@wwinf2215
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-novice by date

  From Date Subject
Next Message Cliff Nieuwenhuis 2008-10-27 01:44:37 Re: combining tables
Previous Message G. J. Walsh 2008-10-26 05:26:56 Re: combining tables