Lazarus

Announcements => Third party => Topic started by: fercosta80 on June 10, 2016, 01:04:30 pm

Title: [SOLVED] Problems with characters in Oracle DB.
Post by: fercosta80 on June 10, 2016, 01:04:30 pm
Hi.

I developed an application that accesses an Oracle database. When I run the application on my computer, everything works normally. But when I run on another computer, the characters 'é', 'í', 'ã' are not shown properly. In their place appear '??'. I need help. I've tried several conversion functions and nothing worked (AnsiToUTF8, CP1252ToUTF8 etc). 

Thanks.
Title: Re: Problems with characters in Oracle DB.
Post by: Thaddy on June 10, 2016, 01:48:00 pm
You should query the codepage of the USER first. Then in your code determine if and when conversion is necessary.
I assume you have a reasonable codepage/character encoding  for your database (like UTF8) to store your data: not FPC level but database level.
Title: Re: Problems with characters in Oracle DB.
Post by: balazsszekely on June 10, 2016, 02:11:17 pm
Set the CharSet property of the TOracleConnection component, so it match the database character encoding. Ideally it should be UTF8. 
Title: Re: Problems with characters in Oracle DB.
Post by: fercosta80 on June 10, 2016, 03:22:38 pm
Problem solved!

The solution was as follows: on the computer where the software will run, created an environment variable in Windows called NLS_LANG and put to value the string BRAZILIAN PORTUGUESE_BRAZIL.AL32UTF8. The characters now appear correctly in the application.  :D :D :D

Thanks to GetMem and Thaddy for your answers.
TinyPortal © 2005-2018