This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

fix Albino::Multi accepting UTF-8 input

  • Loading branch information...
1 parent a10d3e1 commit ea72e6451ac48048c7e7e241bf9cfbbc666c778d @mislav mislav committed Oct 8, 2011
Showing with 8 additions and 0 deletions.
  1. +7 −0 test/multi_albino_test.rb
  2. +1 −0 vendor/multipygmentize
@@ -1,3 +1,5 @@
+# coding: utf-8
+
require 'rubygems'
require 'albino/multi'
require 'test/unit'
@@ -27,6 +29,11 @@ def test_forces_utf8
end
end
+ def test_accepts_utf8
+ code = Albino::Multi.colorize('éøü', :html)
+ assert_includes code, "<pre>éøü\n</pre>"
+ end
+
def test_works_with_strings
syntaxer = Albino::Multi.new("class New\nend", :ruby)
assert_match %r(highlight), code=syntaxer.colorize
View
@@ -14,6 +14,7 @@
import sys, os, codecs
+sys.stdin = codecs.getreader('UTF-8')(sys.stdin)
sys.stdout = codecs.getwriter('UTF-8')(sys.stdout)
vpath = os.path.realpath(__file__).split("/")

0 comments on commit ea72e64

Please sign in to comment.