[mythtv-commits] Ticket #9836: UTF-16LE .srt subtitle files do not work
MythTV
noreply at mythtv.org
Sun Nov 27 09:25:09 UTC 2011
#9836: UTF-16LE .srt subtitle files do not work
-------------------------------------+----------------------------
Reporter: joe@… | Owner:
Type: Bug Report - General | Status: assigned
Priority: minor | Milestone: unknown
Component: MythTV - Video Playback | Version: 0.24-fixes
Severity: medium | Resolution:
Keywords: subtitle srt utf-16 | Ticket locked: 0
-------------------------------------+----------------------------
Comment (by markk):
I've attached a patch that should fix the issue.
The root problem is that the code imported from xine does not handle
multi-byte encodings. The 'cleanest' route would be to ensure it does.
Instead I've taken the approach of probing the subtitle file for a UTF
encoding, using it if detected and otherwise falling back to the encoding
setting. The file is then loaded in full and converted to unicode,
converted back to utf-8 for parsing and finally converted back to unicode
for presentation. Not pretty but I couldn't see another way of doing it
without touching the actual parsing code.
The only problem is that it doesn't seem to handle files converted to utf
using iconv. Material converted inside QtCreator (i.e. probably using Qt
code) seems to work fine.
--
Ticket URL: <http://code.mythtv.org/trac/ticket/9836#comment:5>
MythTV <http://code.mythtv.org/trac>
MythTV Media Center
More information about the mythtv-commits
mailing list