Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

[mb-commits] r9211 - mb_server/branches/TaggingAgain-BRANCH/cgi-bin/MusicBr: msg#00030

audio.musicbrainz.cvs

Subject: [mb-commits] r9211 - mb_server/branches/TaggingAgain-BRANCH/cgi-bin/MusicBrainz/Server

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>
Google Custom Search

Recently Viewed:
hardware.arm.at...    cms.citadel.dev...    video.gstreamer...    java.facelets.u...    misc.basics.qna...    web.wiki.instik...    network.uip.use...    xdg.devel/2003-...    tex.bibtex.bibd...    finance.quotesp...    ietf.zeroconf/2...    redhat.blinux.g...    suse.db2/2003-0...    php.phpesp/2004...    uml.devel/2003-...    gnome.labyrinth...    qnx.openqnx.dev...    boot-loaders.gr...    db.dataperfect....    audio.audacity....    linux.uclinux.m...    editors.j.devel...    os.openbsd.tech...    kde.users.multi...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive 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

Navigation