Opened 17 years ago

Closed 17 years ago

Last modified 15 years ago

#57 closed Defect (fixed)

Code for boincstats pages

Reported by: mo.v Owned by: davea
Priority: Major Milestone: 5.10
Component: Web - Project Version:
Keywords: charset stats xml db_dump Cc:

Description

On cpdn we have a team trying unsuccessfully to make its name, Universität der Bundeswehr München, display properly on its Boincstats page:

http://www.boincstats.com/stats/team_graph.php?pr=cpdn&id=5624

though on cpdn it displays correctly:

http://climateapps2.oucs.ox.ac.uk/cpdnboinc/team_display.php?teamid=5624

Cpdn member Richard Rodway says

It's definitely UTF-8 that's appearing on the boincstats pages and it looks like the correct (2 byte) UTF-8 sequences are being used. Unfortunately the page is being served as an ISO8859-1 page and as a result the 2 byte sequence is not being interpreted as one character, but as two. This apparently is being done by the server since it's specifically encoding these bytes to appear correctly as 8859-1 characters, so changing the page encoding in the browser will not work! (It's using html entities to render the characters)

I notice that the climateprediction page for that team is also a 8859-1 encoded page, but in this case the correct code values are being used. 'ä' is encoded as the single byte 0xE4 in 8859-1 and this is being used on the cpdn pages.

I don't know how the team name is getting propagated to the boincstats servers, but something in the way has translated that to UTF-8. The encoding for 'ä' in UTF-8 is the 2 byte sequence 0xC3 0xA4. However if you read that as 8859-1 then instead of translating that sequence into the one character U+00E4 (ä) it gets viewed as the 2 8859-1 characters 0xC3 and 0xA4. 0xC3 is a Ã, 0xA4 is a ¤ . The server is reading the UTF-8 sequence, and probably then storing it unchanged in the database. Then whenever a page is generated, it's reading that data from the database and assuming that it is ISO8859-1

To fix the problem you need to make sure that whatever is sending the team names to boincstats is doing so in an encoding that boincstats understands. There's nothing at all wrong with UTF-8, and my preferred solution is for boincstats to use UTF-8 in its webpages and database (or at least some variant of Unicode in the database). Not only would this fix this problem, it'd also allow teams (and names) to use any character. Such as Japanese or Korean characters... Which is quite impossible in 8859-1, there's only 256 characters in that characterset, as opposed to about 1.1 million in Unicode... (although I think only about 150,000 are currently in use).

The cpdn discussion is here - one sees that none of the usual solutions work:

http://climateapps2.oucs.ox.ac.uk/cpdnboinc/forum_thread.php?id=5409

This problem must affect teams from all projects. Any hope of a solution?

Richard Rodway and Mo Vilar

Attachments (1)

ticket-57 v1.diff (3.0 KB) - added by Christian Beer 17 years ago.
This patch will encode all umlauts and other strange characters within teamname, team description and username into proper html entities. User and teams with such strange characters in their names should edit their names after this patch was applied at there project.

Download all attachments as: .zip

Change History (15)

comment:1 Changed 17 years ago by romw

Component: UndeterminedServer - Web - Project
Milestone: Undetermined5.10
Owner: set to romw
Priority: UndeterminedMajor
Status: newassigned

comment:2 Changed 17 years ago by romw

Owner: changed from romw to Rytis
Status: assignednew

comment:3 Changed 17 years ago by Rytis

Not a project web problem, but actually stats export. Changing stats exporter to use utf-8 should fix the problem. I won't do that, it's not PHP code. Anyone?

comment:4 Changed 17 years ago by Rytis

Owner: Rytis deleted

comment:5 Changed 17 years ago by romw

Milestone: 5.105.12
Owner: set to davea

David?

comment:6 Changed 17 years ago by milo.thurston@…

May I ask what part of the code the "stats exporter" is in?

comment:7 Changed 17 years ago by davea

Milestone: 6.05.10
Resolution: wontfix
Status: newclosed

comment:8 Changed 17 years ago by davea

This is not relevant to BOINC

comment:9 Changed 17 years ago by maureenvilar@…

Resolution: wontfix
Status: closedreopened

Who should we take the problem to?

comment:10 Changed 17 years ago by davea

Resolution: fixed
Status: reopenedclosed

Boincstats is run by Willy de Zutter: willy1@…

comment:11 Changed 17 years ago by Willy

Resolution: fixed
Status: closedreopened

This is not a stats site problem, the XML is encoded incorrectly. Not going to type it all again, the story is here: http://www.boincstats.com/forum/forum_thread.php?id=2082

comment:12 Changed 17 years ago by Nicolas

Keywords: charset stats xml db_dump added

It's a deficiency on db_dump. Why would that that be "not relevant to BOINC"?

comment:13 Changed 17 years ago by Christian Beer

It's not entirely db_dump that's wrong here. There is a serious fault when entering usernames and teamnames into the DB. The special characters (umlauts: äöü) are not encoded into html entities. So we have to encode the ä to ä for example. Every browser understands these tags and we don't have to cope with UTF-8 or ISO-8859-1. I'm currently working on a function that can be used to do this. I'll post the diffs later.

Changed 17 years ago by Christian Beer

Attachment: ticket-57 v1.diff added

This patch will encode all umlauts and other strange characters within teamname, team description and username into proper html entities. User and teams with such strange characters in their names should edit their names after this patch was applied at there project.

comment:14 Changed 17 years ago by Rytis

Resolution: fixed
Status: reopenedclosed

(In [12691]) Encode UTF characters into HTML entities (from ChristianB, fix #57).

NOTE: teams that have name display issues will have to edit their description once the projects update the code.

Note: See TracTickets for help on using tickets.