>>306 はうまくいくのですが、

#!/usr/bin/ruby
$KCODE='SJIS'
str='表'
if str =~ /表/ then
puts str
end

はだめです。どうしてですか?