Opened 13 years ago

Closed 12 years ago

#211 closed defect (fixed)

tags with special/international characters is displayed and linked incorrectly

Reported by: miki Owned by: steve@…
Priority: major Milestone:
Component: website Version:
Keywords: Cc:


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 for an example (trace 3330).

Just saw that on the detailed page when clicking more (at both text and link is ok.

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


Change History (2)

comment:1 Changed 13 years ago by erik@…

Priority: minormajor

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 = rowtags?.split() unless rowtags?.nil?

to this:

tags = dao.gpx_tags(rowid?)

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 = rowtags?.split() unless rowtags?.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

comment:2 Changed 12 years ago by Tom Hughes

Resolution: fixed
Status: newclosed

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

Note: See TracTickets for help on using tickets.