Permalink
Browse files

fix unencodable error in 1.9.2 in Vpim.encode_paramtext and Vpim.enco…

…de_paramvalue
  • Loading branch information...
1 parent 052275a commit 533191ae01c194c81f045fed3c346a8248ffe8ad @rlivsey committed Aug 29, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/vpim/rfc2425.rb
View
@@ -290,7 +290,7 @@ def Vpim.decode_text_list(value, sep = ',') # :nodoc:
# quoted-string = DQUOTE *QSAFE-CHAR DQUOTE
def Vpim.encode_paramtext(value)
case value
- when %r{\A#{Bnf::SAFECHAR}*\z}
+ when Regexp.new("\\A#{Bnf::SAFECHAR}*\\z", nil, 'n')
value
else
raise Vpim::Unencodeable, "paramtext #{value.inspect}"
@@ -299,9 +299,9 @@ def Vpim.encode_paramtext(value)
def Vpim.encode_paramvalue(value)
case value
- when %r{\A#{Bnf::SAFECHAR}*\z}
+ when Regexp.new("\\A#{Bnf::SAFECHAR}*\\z", nil, 'n')
value
- when %r{\A#{Bnf::QSAFECHAR}*\z}
+ when Regexp.new("\\A#{Bnf::QSAFECHAR}*\\z", nil, 'n')
'"' + value + '"'
else
raise Vpim::Unencodeable, "param-value #{value.inspect}"

0 comments on commit 533191a

Please sign in to comment.