Recent

Author Topic: [SOLVED] Problems with characters in Oracle DB.  (Read 2636 times)

fercosta80

  • New Member
  • *
  • Posts: 17
[SOLVED] Problems with characters in Oracle DB.
« 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.
« Last Edit: June 10, 2016, 03:27:23 pm by fercosta80 »

Thaddy

  • Hero Member
  • *****
  • Posts: 10725
Re: Problems with characters in Oracle DB.
« Reply #1 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.
« Last Edit: June 10, 2016, 01:50:45 pm by Thaddy »

GetMem

  • Hero Member
  • *****
  • Posts: 3984
Re: Problems with characters in Oracle DB.
« Reply #2 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. 

fercosta80

  • New Member
  • *
  • Posts: 17
Re: Problems with characters in Oracle DB.
« Reply #3 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.
« Last Edit: June 10, 2016, 03:27:46 pm by fercosta80 »

 

TinyPortal © 2005-2018