Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

tags with special/international characters is displayed and linked incorrectly #211

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 2 comments

Comments

@openstreetmap-trac
Copy link

Reporter: memb_openstreetmap[at]mikini.dk
[Submitted to the original trac issue database at 12.54pm, Saturday, 29th April 2006]

When a tag contains special characters, like a danish (ASCII 0xe5/#229, HTML å, UTF-16 0x005e, UTF-8 0xc3 0xa5), the two raw UTF-8 values (0xc3 and 0xa5 in my example) is sent to the browser in both text and link which interprets it as two seperate (utf-16?) characters. Thus both text and link is broken.

See my listing at http://www.openstreetmap.org/traces/user/Mikkel%20Kirkgaard%20Nielsen for an example (trace 3330).

Just saw that on the detailed page when clicking more (at http://www.openstreetmap.org/traces/user/miki/3330) both text and link is ok.

Tested using Firefox 1.5.0.2 and IE 5.50 on win98, but I guess it's browser independent.

Mikkel,

@openstreetmap-trac
Copy link
Author

Author: erik[at]tiq.com
[Added to the original trac issue at 3.32pm, Sunday, 21st May 2006]

They get the data in different manners. *render_gpx_list.rhtml'' uses *dao.gpx_files''' and ''upload.gpx.rhtml'' uses 'dao.gpx_tags

== Solution 1 ==

perhaps changing this in render_gpx_list:
tags = row['tags'].split() unless row['tags'].nil?
to this:
tags = dao.gpx_tags(row['id'])

might work.

but this will create lots of unnecesary SQL calls.

== Solution 2 ==

The problem is in dao.rb, where the SQL is different.
This returns UTF-8
select gpx_id,group_concat(tag SEPARATOR ' ') as tags from gpx_file_tags group by gpx_id)
tags = row['tags'].split() unless row['tags'].nil?

vs.
This that returns latin-1
select tag from gpx_file_tags where gpx_id = #{q(gpx_id.to_s)} order by sequence_id asc
res.each { |tag| tags << tag[0] }
return tags

@openstreetmap-trac
Copy link
Author

Author: tom[at]compton.nu
[Added to the original trac issue at 10.59pm, Sunday, 19th August 2007]

As far as I can see this works fine in the rails port.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant