Opened 9 years ago

Closed 4 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


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 by Even Rouault, 8 years ago

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 by bishop, 8 years ago

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

comment:3 by Even Rouault, 8 years ago

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

comment:4 by Even Rouault, 4 years ago

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 if it is not already reported there.

Note: See TracTickets for help on using tickets.