Opened 8 years ago

Closed 3 years ago

#5295 closed defect (wontfix)

tolower damage UTF-8 strings

Reported by: bishop Owned by: warmerdam
Priority: normal Milestone: closed_because_of_github_migration
Component: default Version: svn-trunk
Severity: normal Keywords: CPLString tolower
Cc:

Description

The CPLString.tolower or tolower in some functions (e.g. char *OGRPGDataSource::LaunderName?) damage input national strings.

For example if I try to create layer in PostGIS with national name (e.g. 'тест'), I received unreadable character in database.

Walkaround:set layer create option

papszLayerOptions = CSLAddNameValue(papszLayerOptions, "LAUNDER", "NO");

I think for UTF encoded strings the towlower function should be using.

Change History (4)

comment:1 Changed 7 years ago by Even Rouault

According to the manpage of towlower : "This function is not very appropriate for dealing with Unicode characters, because Unicode knows about three cases: upper, lower and title case."

comment:2 Changed 7 years ago by bishop

And what is your opinion how this issue can be solved?

comment:3 Changed 7 years ago by Even Rouault

Perhaps skip the laundering if it is not an ASCII string ?

comment:4 Changed 3 years ago by Even Rouault

Milestone: closed_because_of_github_migration
Resolution: wontfix
Status: newclosed

This ticket has been automatically closed because Trac is no longer used for GDAL bug tracking, since the project has migrated to GitHub?. If you believe this ticket is still valid, you may file it to https://github.com/OSGeo/gdal/issues if it is not already reported there.

Note: See TracTickets for help on using tickets.