Skip to content

Instantly share code, notes, and snippets.

View strzibny's full-sized avatar
🏠
Working from home

Josef Strzibny strzibny

🏠
Working from home
View GitHub Profile
SHELL = /bin/sh
# V=0 quiet, V=1 verbose. other values don't work.
V = 1
Q1 = $(V:1=)
Q = $(Q1:0=@)
ECHO1 = $(V:1=@:)
ECHO = $(ECHO1:0=@echo)
@strzibny
strzibny / gist:5108279
Created March 7, 2013 14:07
idn RubyGem patch for Ruby 2 which has standard encoding set to UTF-8 so you cannot count on comparison with standard strings
diff --git a/test/tc_Stringprep.rb b/test/tc_Stringprep.rb
index c7f15cb..bcdd401 100644
--- a/test/tc_Stringprep.rb
+++ b/test/tc_Stringprep.rb
@@ -60,7 +60,7 @@ class Test_Stringprep < Test::Unit::TestCase
def test_with_profile_STRINGPREP
TESTCASES_STRINGPREP.each do |key, val|
rc = Stringprep.with_profile(val[1], val[0])
- assert_equal(val[2], rc, "TestCase #{key} failed")
+ assert_equal(val[2].force_encoding('ASCII-8BIT'), rc, "TestCase #{key} failed")