|
|
Choosing A Webhost: |
[mb-commits] r9211 - mb_server/branches/TaggingAgain-BRANCH/cgi-bin/MusicBr: msg#00030audio.musicbrainz.cvs
Author: luks Date: 2007-06-24 08:07:21 +0000 (Sun, 24 Jun 2007) New Revision: 9211 Modified: mb_server/branches/TaggingAgain-BRANCH/cgi-bin/MusicBrainz/Server/Tag.pm Log: Don't replace non-ascii 'word' characters in tag names. Allow '-' in tag names. Modified: mb_server/branches/TaggingAgain-BRANCH/cgi-bin/MusicBrainz/Server/Tag.pm =================================================================== --- mb_server/branches/TaggingAgain-BRANCH/cgi-bin/MusicBrainz/Server/Tag.pm 2007-06-23 22:26:05 UTC (rev 9210) +++ mb_server/branches/TaggingAgain-BRANCH/cgi-bin/MusicBrainz/Server/Tag.pm 2007-06-24 08:07:21 UTC (rev 9211) @@ -32,6 +32,7 @@ use List::Util qw( min max ); use URI::Escape qw( uri_escape ); use MusicBrainz::Server::Validation qw( encode_entities ); +use Encode qw( decode encode ); sub Update { @@ -41,13 +42,14 @@ @new_tags = grep { # remove non-word characters - $_ =~ s/\W+/ /sg; + $_ =~ s/[^\p{IsWord}-]+/ /sg; # combine multiple spaces into one $_ =~ s/\s+/ /sg; # remove leading and trailing whitespace $_ =~ s/^\s*(.*?)\s*$/$1/; + $_ = encode "utf-8", $_; $_; - } split ',', lc($input); + } split ',', lc(decode "utf-8", $input); # make sure the list contains only unique tags @new_tags = keys %{{ map { $_ => 1 } @new_tags }};
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [mb-commits] r9210 - mb_server/branches/TaggingAgain-BRANCH/cgi-bin/MusicBrainz/Server/Handlers/WS/1, root |
|---|---|
| Next by Date: | [mb-commits] r9212 - in mb_server/branches/TaggingAgain-BRANCH: cgi-bin/MusicBrainz/Server htdocs/comp htdocs/show/tag, root |
| Previous by Thread: | [mb-commits] r9210 - mb_server/branches/TaggingAgain-BRANCH/cgi-bin/MusicBrainz/Server/Handlers/WS/1, root |
| Next by Thread: | [mb-commits] r9212 - in mb_server/branches/TaggingAgain-BRANCH: cgi-bin/MusicBrainz/Server htdocs/comp htdocs/show/tag, root |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |