Issue Details (XML | Word | Printable)

Key: MBS-2911
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Normal Normal
Assignee: Oliver Charles
Reporter: nikki
Votes: 1
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
MusicBrainz Server

URL decoding should not decode non-utf-8 strings

Created: 27/Jun/11 10:24 PM   Updated: 03/Oct/11 11:01 AM   Resolved: 03/Oct/11 11:01 AM
Component/s: Data display
Affects Version/s: None
Fix Version/s: Bug fixes, 2011-09-19, Bug fixes, 2011-09-26

Issue Links:
Duplicate
 
Relates
 
Resolution
 


 Description  « Hide

see for example http://musicbrainz.org/url/43d9b0d8-28ce-4bbb-836e-01ac42d8bbcd/relationships which is incorrectly displayed as "nl: Bl�f"

in classic, this was left encoded - http://classic.musicbrainz.org/show/url/?urlid=624



Sort Order: Ascending order - Click to sort in descending order
Johannes Weißl added a comment - 06/Aug/11 02:23 AM

+1, bug is still there


Oliver Charles added a comment - 08/Aug/11 03:18 PM - edited

Well, I've looked into this. If uri_decode is:

sub uri_decode { uri_unescape(shift) }

Then the url in the description works, but other scripts fail to display. If I change it to:

sub uri_decode {
    my $dec = decode('utf-8', uri_unescape(shift));
    Encode::_utf8_on($dec);
    return $dec;
}

Then other scripts work, but the above doesn't! I'm pretty confused, Unicode can be such a pain sometimes


Oliver Charles added a comment - 21/Sep/11 09:07 PM

Alright, seems like I was trying to be too clever here. Agreed solution is to go back to the classic behaviour - decode from UTF-8 (strictly), but if that fails don't try to do anything else (just display it as we have it in the database). For URLs that have pretty_names, they should not do anything special again, and just display the URL.


voiceinsideyou added a comment - 22/Sep/11 05:53 AM

Are the changes made here related to MBS-3499?