【发布时间】:2016-07-06 14:21:49
【问题描述】:
在 ruby 中使用不间断空格对字符串进行充气和放气时遇到了一个奇怪的问题。
带有常规空格的字符串按预期表现:
str = "hello world"; str_zipped = Zlib.deflate str; str == Zlib.inflate(str_zipped)
=> true
然而,
str = "hello\xA0world"; str_zipped = Zlib.deflate str; str == Zlib.inflate(str_zipped)
=> false
这是预期的行为还是错误?
【问题讨论】:
标签: ruby whitespace zlib