Re: [gnome-db] Problems with accents using libgda



El lun, 21 de 04 de 2003 a las 18:48, Fabrício Barros Cabral escribió:
> Hi people!
> 
> 
> Well, I'm developing a program using only the libgda library, but I having a problem wit it:
> It isn't showing to me the accents of my database. The database was created with encoding
> "latin1".My RDBMS is the PostgreSQL 7.3.2r1-2 and the GDA provider is gda2-postgres 0.11.0-2
> (both from Debian SID).
> 
> I solved the problem with this statement:
> 
> execute_sql_non_query (connection, "SET CLIENT_ENCODING TO 'LATIN1'");

libgda providers are supposed to return UTF-8 strings. That's why the
postgresql provider does: SET CLIENT_ENCODING TO 'UNICODE' when the
connection is established.

It works fine for me with 7.3.2r1 and prior releases.

After that, g_print should work with strings returned from the provider.
If you want to use printf on those strings, you'll need
'g_locale_from_utf8'.

You can try this to see how this works:
      * From your terminal, if it's not already in UTF8 mode, type:

                echo "\033%G"
        
        This will make your terminal UTF8 aware.
        
      * connect to the database you're talking about using psql.
      * SET CLIENT_ENCODING TO 'UNICODE'
        (This should make it display 'SET')
      * Retrieve some column that contains accented letters or whatever.
        It should be displayed correctly.

If this works, libgda whould work too.

-Gonzalo





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]