From: 7stud -- Date: 2012-12-25T17:15:46+09:00 Subject: Re: Character encoding in 1.9 line = "hello\377\373\001 \377\374\001 \377\375\001world" (3..7).each do |n| pattern = "\377" << (0370 + n).chr << "\001" line.gsub! pattern, " " puts line end --output:-- hello ?? ??world hello ??world hello world hello world hello world -- Posted via http://www.ruby-forum.com/.