mirror of
https://github.com/ruby/ruby.git
synced 2025-09-22 03:53:58 +02:00
pack.c: escape and encoding
* pack.c (pack_pack): escape unprintable characters and preserve the encoding of warning message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
fa892d27af
commit
1f53145dd4
3 changed files with 25 additions and 3 deletions
|
@ -718,5 +718,13 @@ EXPECTED
|
|||
assert_warning(/unknown pack directive ',' in ','/) {
|
||||
[].pack(",")
|
||||
}
|
||||
assert_warning(/\A[ -~]+\Z/) {
|
||||
[].pack("\x7f")
|
||||
}
|
||||
assert_warning(/\A(.* in '\u{3042}'\n)+\z/) {
|
||||
EnvUtil.with_default_external(Encoding::UTF_8) {
|
||||
[].pack("\u{3042}")
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue