--- pygments-0.10.orig/debian/patches/make_utf8_default.patch
+++ pygments-0.10/debian/patches/make_utf8_default.patch
@@ -0,0 +1,60 @@
+Index: pygments-0.10/pygments/cmdline.py
+===================================================================
+--- pygments-0.10.orig/pygments/cmdline.py
++++ pygments-0.10/pygments/cmdline.py
+@@ -351,17 +351,17 @@ def main(args=sys.argv):
+             return 2
+         code = sys.stdin.read()
+ 
+-    # No encoding given? Use latin1 if output file given,
++    # No encoding given? Use utf-8 if output file given,
+     # stdin/stdout encoding otherwise.
+     # (This is a compromise, I'm not too happy with it...)
+     if 'encoding' not in parsed_opts and 'outencoding' not in parsed_opts:
+         if outfn:
+             # encoding pass-through
+-            fmter.encoding = 'latin1'
++            fmter.encoding = 'utf-8'
+         else:
+             # use terminal encoding
+-            lexer.encoding = getattr(sys.stdin, 'encoding', None) or 'ascii'
+-            fmter.encoding = getattr(sys.stdout, 'encoding', None) or 'ascii'
++            lexer.encoding = getattr(sys.stdin, 'encoding', None) or 'utf-8'
++            fmter.encoding = getattr(sys.stdout, 'encoding', None) or 'utf-8'
+ 
+     # ... and do it!
+     try:
+Index: pygments-0.10/pygments/formatters/latex.py
+===================================================================
+--- pygments-0.10.orig/pygments/formatters/latex.py
++++ pygments-0.10/pygments/formatters/latex.py
+@@ -236,6 +236,6 @@ class LatexFormatter(Formatter):
+                 dict(docclass  = self.docclass,
+                      preamble  = self.preamble,
+                      title     = self.title,
+-                     encoding  = self.encoding or 'latin1',
++                     encoding  = self.encoding or 'utf-8',
+                      styledefs = self.get_style_defs(),
+                      code      = outfile.getvalue()))
+Index: pygments-0.10/pygments/lexer.py
+===================================================================
+--- pygments-0.10.orig/pygments/lexer.py
++++ pygments-0.10/pygments/lexer.py
+@@ -56,7 +56,7 @@ class Lexer(object):
+     ``encoding``
+         If given, must be an encoding name. This encoding will be used to
+         convert the input string to Unicode, if it is not already a Unicode
+-        string (default: ``'latin1'``).
++        string (default: ``'utf-8'``).
+         Can also be ``'guess'`` to use a simple UTF-8 / Latin1 detection, or
+         ``'chardet'`` to use the chardet library, if it is installed.
+     """
+@@ -83,7 +83,7 @@ class Lexer(object):
+         self.stripnl = get_bool_opt(options, 'stripnl', True)
+         self.stripall = get_bool_opt(options, 'stripall', False)
+         self.tabsize = get_int_opt(options, 'tabsize', 0)
+-        self.encoding = options.get('encoding', 'latin1')
++        self.encoding = options.get('encoding', 'utf-8')
+         # self.encoding = options.get('inencoding', None) or self.encoding
+         self.filters = []
+         for filter_ in get_list_opt(options, 'filters', ()):
--- pygments-0.10.orig/debian/patches/series
+++ pygments-0.10/debian/patches/series
@@ -0,0 +1,2 @@
+make_utf8_default.patch
+disable_ez_setup.patch
--- pygments-0.10.orig/debian/patches/disable_ez_setup.patch
+++ pygments-0.10/debian/patches/disable_ez_setup.patch
@@ -0,0 +1,14 @@
+Index: pygments-0.9/setup.py
+===================================================================
+--- pygments-0.9.orig/setup.py
++++ pygments-0.9/setup.py
+@@ -1,7 +1,7 @@
+ #!/usr/bin/env python
+ # -*- coding: utf-8 -*-
+-import ez_setup
+-ez_setup.use_setuptools()
++#import ez_setup
++#ez_setup.use_setuptools()
+ from setuptools import setup, find_packages
+ 
+ import pygments
--- pygments-0.10.orig/debian/manpages
+++ pygments-0.10/debian/manpages
@@ -0,0 +1 @@
+docs/pygmentize.1
--- pygments-0.10.orig/debian/pygmentize
+++ pygments-0.10/debian/pygmentize
@@ -0,0 +1,3 @@
+#! /usr/bin/python
+import pygments.cmdline
+pygments.cmdline.main()
--- pygments-0.10.orig/debian/dirs
+++ pygments-0.10/debian/dirs
@@ -0,0 +1 @@
+/usr/share/doc/python-pygments
--- pygments-0.10.orig/debian/copyright
+++ pygments-0.10/debian/copyright
@@ -0,0 +1,45 @@
+This package was debianized by Piotr Ożarowski <piotr@debian.org> on
+Tue, 24 Oct 2006 17:54:36 +0200.
+
+It was downloaded from http://pygments.pocoo.org/download/
+
+Upstream Author: Georg Brandl <g.brandl@gmx.net>
+
+Copyright: 2006-2008 by Georg Brandl, Armin Ronacher, Lukas Meuser and others
+(see AUTHORS file)
+
+License:
+
+ Copyright (c) 2006 by the respective authors (see AUTHORS file).
+ All rights reserved.
+ 
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ 
+     * Redistributions of source code must retain the above copyright
+       notice, this list of conditions and the following disclaimer.
+ 
+     * Redistributions in binary form must reproduce the above
+       copyright notice, this list of conditions and the following
+       disclaimer in the documentation and/or other materials provided
+       with the distribution.
+ 
+     * The names of the contributors may not be used to endorse or
+       promote products derived from this software without specific
+       prior written permission.
+ 
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+The Debian packaging is (C) 2006-2008, Piotr Ożarowski <piotr@debian.org> and
+is licensed under the same licence as pygments.
--- pygments-0.10.orig/debian/compat
+++ pygments-0.10/debian/compat
@@ -0,0 +1 @@
+5
--- pygments-0.10.orig/debian/watch
+++ pygments-0.10/debian/watch
@@ -0,0 +1,2 @@
+version=3
+http://cheeseshop.python.org/packages/source/P/Pygments/Pygments-(.*)\.tar\.gz
--- pygments-0.10.orig/debian/changelog
+++ pygments-0.10/debian/changelog
@@ -0,0 +1,105 @@
+pygments (0.10-1~bpo40+1) etch-backports; urgency=low
+
+  * Rebuild for etch-backports
+  * Use python-support 0.5.6
+    + rename Egg dir in debian/rules
+    + remove empty /usr/lib/ dir
+  * Don't use bzip2 to compress binary package
+  * Don't build docs - Etch's python-jinja package is too old, ship upstream's
+
+ -- Piotr Ożarowski <piotr@debian.org>  Thu, 02 Oct 2008 19:16:01 +0200
+
+pygments (0.10-1) unstable; urgency=low
+
+  * New upstream release
+  * Add make_utf8_default patch - useful while using pygmentize with pipes
+    (use: pygmentize -P 'encoding=ascii' if you want old behaviour)
+  * Install debian/pygmentize instead of script created by setuptools
+  * Change Debian packaging licence to match upstream
+
+ -- Piotr Ożarowski <piotr@debian.org>  Wed, 07 May 2008 20:38:26 +0200
+
+pygments (0.9-3) unstable; urgency=low
+
+  [ Sandro Tosi ]
+  * debian/control
+    - uniforming Vcs-Browser field
+
+  [ Piotr Ożarowski ]
+  * Switch to python-support
+  * Replace python-setuptools runtime dependency with new python-pkg-resources
+    (closes: 468710)
+  * Compress binary package with bzip2
+  * Strip the "-1" from quilt's and setuptools' required build versions
+
+ -- Piotr Ożarowski <piotr@debian.org>  Sat, 01 Mar 2008 13:37:39 +0100
+
+pygments (0.9-2) unstable; urgency=low
+
+  * Install original pygmentize script (not touched by setuptools)
+    (closes: 455222)
+  * Bump Standards-Version to 3.7.3 (no changes needed)
+
+ -- Piotr Ożarowski <piotr@debian.org>  Mon, 10 Dec 2007 19:59:55 +0100
+
+pygments (0.9-1) unstable; urgency=low
+
+  * New upstream release
+  * Add patch that disables ez_setup at build time
+    - quilt added to Build-Depends
+  * Homepage field added
+  * Rename XS-Vcs-* fields to Vcs-* (dpkg supports them now)
+
+ -- Piotr Ożarowski <piotr@debian.org>  Mon, 15 Oct 2007 22:37:08 +0200
+
+pygments (0.8.1-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Piotr Ożarowski <piotr@debian.org>  Thu, 28 Jun 2007 15:08:22 +0200
+
+pygments (0.8-1) unstable; urgency=low
+
+  * New upstream release
+  * Bump required Jinja version (build dependency)
+  * Added python-setuptools to Recommends
+
+ -- Piotr Ożarowski <piotr@debian.org>  Wed, 30 May 2007 19:33:29 +0200
+
+pygments (0.7.1-2) unstable; urgency=low
+
+  * Upload to unstable
+  * debian/copyright file updated
+  * Changed my address to piotr@debian.org
+
+ -- Piotr Ożarowski <piotr@debian.org>  Mon, 09 Apr 2007 20:18:54 +0200
+
+pygments (0.7.1-1) experimental; urgency=low
+
+  * New upstream release (upload to experimental due to Etch freeze)
+
+ -- Piotr Ozarowski <ozarow@gmail.com>  Thu, 15 Feb 2007 21:17:10 +0100
+
+pygments (0.7-1) experimental; urgency=low
+
+  * New upstream release (upload to experimental due to Etch freeze)
+  * Some debian/rules cleanups
+
+ -- Piotr Ozarowski <ozarow@gmail.com>  Wed, 14 Feb 2007 21:52:50 +0100
+
+pygments (0.6-1) experimental; urgency=low
+
+  * New upstream release (upload to experimental due to Etch freeze)
+  * Added XS-Vcs-Svn and XS-Vcs-Browser fields to debian/control
+  * Added python-chardet to Recommends: (guessing input encoding added)
+  * debian/copyright updated (license change to BSD)
+  * Removed debian/pygmentize.1 manpage (it's in upstream sources now)
+
+ -- Piotr Ozarowski <ozarow@gmail.com>  Thu, 21 Dec 2006 16:20:10 +0100
+
+pygments (0.5.1-1) unstable; urgency=low
+
+  * Initial release (closes: #395064)
+
+ -- Piotr Ozarowski <ozarow@gmail.com>  Mon, 30 Oct 2006 17:19:10 +0100
+
--- pygments-0.10.orig/debian/rules
+++ pygments-0.10/debian/rules
@@ -0,0 +1,55 @@
+#!/usr/bin/make -f
+
+#export DH_VERBOSE=1
+
+PYVERS ?= $(shell pyversions -vr)
+DEB_UPSTREAM_VERSION=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-]+).*,\1,p')
+
+
+include /usr/share/quilt/quilt.make
+
+clean: unpatch
+	dh_testdir
+	dh_testroot
+	rm -rf build Pygments.egg-info
+	find . -name "*\.py[co]" -delete
+	dh_clean build-indep $(PYVERS:%=install-python%)
+
+build: patch build-indep
+
+build-indep:
+	dh_testdir
+	dh_installdirs
+	touch $@
+
+install: build $(PYVERS:%=install-python%)
+install-python%:
+	python$* setup.py install --single-version-externally-managed \
+		--root debian/python-pygments
+	# share Egg dir - remove Python version from dir name
+	mv debian/python-pygments/usr/lib/python$*/site-packages/Pygments-${DEB_UPSTREAM_VERSION}-py$*.egg-info \
+	   debian/python-pygments/usr/lib/python$*/site-packages/Pygments-${DEB_UPSTREAM_VERSION}.egg-info
+
+	touch $@
+
+binary-indep: build install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs -i CHANGES
+	dh_installdocs -i docs/build/*
+	dh_installman -i
+	dh_install -i debian/pygmentize /usr/bin/
+	dh_pysupport -i
+	rm -rf debian/python-pygments/usr/lib/
+	dh_compress -i -X.py
+	dh_fixperms -i
+	dh_installdeb -i
+	dh_gencontrol -i
+	dh_md5sums -i
+	dh_builddeb -i
+
+binary-arch:
+
+binary: binary-indep binary-arch
+
+.PHONY: build clean binary-indep binary-arch binary install
--- pygments-0.10.orig/debian/docs
+++ pygments-0.10/debian/docs
@@ -0,0 +1,2 @@
+AUTHORS
+TODO
--- pygments-0.10.orig/debian/control
+++ pygments-0.10/debian/control
@@ -0,0 +1,31 @@
+Source: pygments
+Section: python
+Priority: optional
+Maintainer: Piotr Ożarowski <piotr@debian.org>
+Uploaders: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
+Build-Depends: debhelper (>= 5), quilt (>=0.40)
+Build-Depends-Indep: python (>= 2.3.5-11), python-all-dev, python-support (>= 0.5.6),
+ python-setuptools (>= 0.6b3), python-docutils
+Standards-Version: 3.7.3
+Homepage: http://pygments.pocoo.org/
+XS-Python-Version: >= 2.3
+Vcs-Svn: svn://svn.debian.org/python-modules/packages/pygments/trunk/
+Vcs-Browser: http://svn.debian.org/wsvn/python-modules/packages/pygments/trunk/?op=log
+
+Package: python-pygments
+Architecture: all
+Depends: ${python:Depends}
+Recommends: python-chardet, python-pkg-resources
+XB-Python-Version: ${python:Versions}
+Description: syntax highlighting package written in Python
+ Pygments aims to be a generic syntax highlighter for general use in all kinds
+ of software such as forum systems, wikis or other applications that need to
+ prettify source code.
+ .
+ Highlights are:
+   * a wide range of common languages and markup formats is supported
+   * special attention is paid to details, increasing quality by a fair amount
+   * support for new languages and formats are added easily
+   * a number of output formats, presently HTML, LaTeX and ANSI sequences
+   * it is usable as a command-line tool and as a library
+   * ... and it highlights even Brainfuck!
