[fdo-trac] #562: Problem with wchar in Linux

FDO trac_fdo at osgeo.org
Fri Sep 25 15:39:58 EDT 2009


#562: Problem with wchar in Linux
-----------------------------------+----------------------------------------
   Reporter:  rafael               |       Owner:  haris
       Type:  defect               |      Status:  new  
   Priority:  major                |   Milestone:  3.5.0
  Component:  KingOracle Provider  |     Version:  3.4.0
   Severity:  2                    |    Keywords:       
External_id:                       |  
-----------------------------------+----------------------------------------
 Unlike Windows UTF-16 2-byte wide chars, wchar_t on Linux and OS X is 4
 bytes UTF-32 (gcc/g++ and XCode).

 Code like this don’t work in Linux:

 Oracle manual:
 “To prepare the SQL statement, call OCIStmtPrepare with (utext*) string.
 The following example runs on Windows platforms only. You may need to
 change wchar_t datatypes for other platforms.


 {{{
 const wchar_t sqlstr[] = L"SELECT * FROM ENAME=:ename";
 ...
 OCIStmt* stmthp;
 sts = OCIHandleAlloc(envh, (void **)&stmthp, OCI_HTYPE_STMT, 0, NULL);
 status = OCIStmtPrepare(stmthp, errhp,(const text*)sqlstr, wcslen(sqlstr),
                         OCI_NTV_SYNTAX, OCI_DEFAULT);
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/fdo/ticket/562>
FDO <http://fdo.osgeo.org/>
Feature Data Objects


More information about the fdo-trac mailing list