2

I am trying to select string written in Arabic letters from oracle database using C++ The problem is i read Chinese characters instead I am using their globalization guide

Environment* env = Environment::createEnvironment(" US7ASCII","OCCIUTF16");
Connection* con=env->createConnection("","","");
Statement* stmt= con->createStatement("select name from table where id=10");
ResultSet* rs= stmt->executeQuery();
While(rs->next())
{
   rs->getUString(1);
}

So how can i read it accurately or what i am missing

pifor
  • 7,419
  • 2
  • 8
  • 16
ma1169
  • 659
  • 1
  • 8
  • 26
  • Please post output of `select parameter, value from nls_database_parameters where parameter like '%SET%';` and what is the exact data type of `name` column ? – pifor Jun 08 '20 at 07:29
  • What is client OS where C++ code runs ? It is Windows with GUI or in character mode ? is this Linux with GUI or character mode ? – pifor Jun 08 '20 at 09:40
  • Name is varchar 2, nls_nchar_characterset AL16UTF16. NLS_CHARACTERSET. AR8MSWIN1256. It runs on windows 10 – ma1169 Jun 08 '20 at 09:43

1 Answers1

0

Try with this code modification:

Environment* env = Environment::createEnvironment("AR8MSWIN1256","OCCIUTF16");
pifor
  • 7,419
  • 2
  • 8
  • 16
  • What is your regional Windows environment ? Do you run the code in GUI or character mode ? What is the output of `chcp` run in `cmd.exe` ? – pifor Jun 08 '20 at 10:07
  • I am debugging the code in the back end ATM if this is what you mean. I have the GUI using winapi ready and it display data accurately, so it's not a gui problem. chcp shows active code page720 – ma1169 Jun 08 '20 at 11:31
  • 1
    What we need to know if Windows runs with Arabic settings, Chinese settings, America settings, etc. ? What is the language used by Windows to display text, menu options, dialog boxes, etc. ? What we currently know is that code page 720 is Arabic. – pifor Jun 08 '20 at 11:35
  • Oh its English UK – ma1169 Jun 08 '20 at 14:15
  • Maybe you need some Windows setup to have arabic characters in GUI. But I cannot help on Windows side. – pifor Jun 08 '20 at 14:31