Method: Storyboard::SRT#fix_encoding

Defined in:
lib/storyboard/subtitles.rb

#fix_encoding(l) ⇒ Object



120
121
122
123
124
125
126
# File 'lib/storyboard/subtitles.rb', line 120

def fix_encoding(l)
  # The only  ISO8859-1  I hit so far. I expec this to grow.
  if !(l.bytes.to_a | [233,146]).empty? && @encoding == 'UTF-8'
    l = l.unpack("C*").pack("U*")
  end
  l
end