[gdal-dev] RFC 23: OGR Unicode

Tamas Szekeres szekerest at gmail.com
Wed Apr 23 16:09:35 EDT 2008


Frank,

In the recent days we've also experienced similar problems with the
OGR OCI driver. I suppose it might be related to the NCHAR or
NVARCHAR2 columns, where the driver cannot figure out the proper
length of the buffer to retrieve the field values. Therefore the OCI
library always reports the following error:

ERROR 1: ORA-01406: fetched column value was truncated
in OCIStmtFetch

Was this issue also addressed by this RFC or some additional changes
should be made inside the driver? I couldn't find out how the driver
will figure out the length of the buffers in these cases.

Here is a  description of the OCI client libraries, that may also be related:

<quote>
If a database column containing character data is defined to be an
NCHAR or NVARCHAR2 column, then a bind or define involving that column
must take into account special considerations for dealing with
character set specifications.

These considerations are necessary in case the width of the client
character set is different from the server character set, and also for
proper character conversion. During conversion of data between
different character sets, the size of the data may increase or
decrease by a factor of four. Insure that buffers provided to hold the
data are of sufficient size.

In some cases, it may also be easier for an application to deal with
NCHAR or NVARCHAR2 data in terms of numbers of characters, rather than
numbers of bytes, which is the usual case.
</quote>

However I'm not sure I totally understand this statement.


Best regards,

Tamas



2008/4/23, Frank Warmerdam <warmerdam at pobox.com>:
> Folks,
>
>  I'm looking to fix reading of NVARCHAR fields via ODBC and in an effort
>  to solve this problem in a reasonably general way, I am proposing to
>  add some mechanisms for encoding changes in CPLString.  This is essentially
>  taking a small bite out of the things that RFC 5 was attempting to address
>  to keep things managable.
>
>   http://trac.osgeo.org/gdal/wiki/rfc23_ogr_unicode
>
>  I'm *not* really interested in expanding the scope a lot at this point, but
>  I would appreciate feedback on the proposed approach before I bring it to a
>  vote.  Note also that my approach to CPLString changes is somewhat
> different
>  than Andrey proposed in RFC 5.  In particular, I do not require that
> CPLStrings
>  always be UTF-8.  Also I use iconv() style names for encodings instead of
> an
>  enumerated list.
>
>  Best regards,
>  --
> ---------------------------------------+--------------------------------------
>  I set the clouds in motion - turn up   | Frank Warmerdam,
> warmerdam at pobox.com
>  light and sound - activate the windows | http://pobox.com/~warmerdam
>  and watch the world go round - Rush    | President OSGeo, http://osgeo.org
>
>  _______________________________________________
>  gdal-dev mailing list
>  gdal-dev at lists.osgeo.org
>  http://lists.osgeo.org/mailman/listinfo/gdal-dev
>


More information about the gdal-dev mailing list