Author: duncan Date: Wed Dec 27 13:53:19 2006 New Revision: 8830 Added: branches/rel-1-6/freevo/src/sitecustomize.py Modified: branches/rel-1-6/freevo/src/util/__init__.py branches/rel-1-6/freevo/src/www/htdocs/library.rpy
Log: [ 1621271 ] Unicode error inserting a CDR [ 1604849 ] 1.7RC1 - Webserver bug Back ported the patch from Harri to minimise Unicode problems Added: branches/rel-1-6/freevo/src/sitecustomize.py ============================================================================== --- (empty file) +++ branches/rel-1-6/freevo/src/sitecustomize.py Wed Dec 27 13:53:19 2006 @@ -0,0 +1,39 @@ +# -*- coding: iso-8859-1 -*- +# ----------------------------------------------------------------------- +# sitecustomize.py - Automatically imported if present +# ----------------------------------------------------------------------- +# $Id: config.py 8658 2006-11-26 19:57:29Z duncan $ +# +# Notes: +# +# Set the default encoding for freevo to be more +# generic that the default ascii. +# +# See http://docs.python.org/lib/module-site.html +# +# Todo: +# +# ----------------------------------------------------------------------- +# Freevo - A Home Theater PC framework +# Copyright (C) 2002 Krister Lagerstrom, et al. +# Please see the file freevo/Docs/CREDITS for a complete list of authors. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MER- +# CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# ----------------------------------------------------------------------- + +import sys + +sys.setdefaultencoding('utf-8') Modified: branches/rel-1-6/freevo/src/util/__init__.py ============================================================================== --- branches/rel-1-6/freevo/src/util/__init__.py (original) +++ branches/rel-1-6/freevo/src/util/__init__.py Wed Dec 27 13:53:19 2006 @@ -54,9 +54,12 @@ try: return unicode(string, config.LOCALE) except Exception, e: - print 'Error: Could not convert %s to unicode' % repr(string) - print 'tried encoding %s and %s' % (encoding, config.LOCALE) - print e + try: + return unicode(string, "iso-8859-15") + except Exception, e: + print 'Error: Could not convert %s to unicode' % repr(string) + print 'tried encoding %s and %s' % (encoding, config.LOCALE) + print e elif string.__class__ != unicode: return unicode(str(string), config.LOCALE) Modified: branches/rel-1-6/freevo/src/www/htdocs/library.rpy ============================================================================== --- branches/rel-1-6/freevo/src/www/htdocs/library.rpy (original) +++ branches/rel-1-6/freevo/src/www/htdocs/library.rpy Wed Dec 27 13:53:19 2006 @@ -344,7 +344,6 @@ # get me the directories to output directorylist = util.getdirnames(String(action_dir)) for mydir in directorylist: - mydir = Unicode(mydir) fv.tableRowOpen('class="chanrow"') mydispdir = os.path.basename(mydir) mydirlink = '<a href="'+ action_script +'?media='+action_mediatype+'&dir='+urllib.quote(mydir)+'">'+mydispdir+'</a>' ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Freevo-cvslog mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/freevo-cvslog
