support mac encoding in ruby mode