Log in

View Full Version : MicroDVD to SRT non-ASCII conversion bug


helge79
30th December 2006, 14:15
It appears that I have just found a rather stupid bug with a few subtitle editors (Subtitle Workshop, Subtitle Processor... but the issue appears to be quite universal, so it may affect many other programs too). I am not sure if this is a good place to report the bug, but I couldn't think of any other...

So, imagine I have a MicroDVD (.sub) subtitle file in (Chinese) big5 encoding and want to convert it to SRT-format (the bug does not in principle depend on whether it is big5, and may affect some other encodings, too).

The rules of big5 encoding (and many other Asian language encodings) are such that, if a character with a numerical code in the range 128-255 is encountered, it is paired with the next character, and this two-character sequence is interpreted as a single hieroglyph (Chinese, in my case). So, for some hieroglyphs (as, for example, for the very common 會), the second ASCII-character in the encoding sequence will be "|".

Now, we all know that, in the MicroDVD format, "|" indicates a line break. So, it must be clear what goes wrong with the subtitle editors: they interpret the "|" appearing in the two-character sequence as a line break, and thus destroy a portion of the text. If you then try to save the file as SRT, all the |'s will be replaced by actual line breaks and the text will come out with quite a few blemishes.

So, if anyone here works on developing subtitle software, perhaps you could take these observations into account. (In my particular case, I found a relatively inconvenient and roundabout way to handle this issue, but it will probably be better if the future versions of the software are free of the bug...)

manusse
31st December 2006, 10:03
Hi helge79,

Maybe you could post a sample .sub file so that developers can test their software with it and eventually fix the bugs.

Cheers
Manusse

helge79
31st December 2006, 11:18
Maybe you could post a sample .sub file so that developers can test their software with it and eventually fix the bugs.
Sure. I've attached a very simple SUB file (with just one line containing just one character in the Big5 encoding), together with the result of converting it to SRT using Subtitle Workshop (once again, it appears that some other editors run into this issue as well).

In the original file, there is a Chinese character represented by the hexadecimal sequence B7 7C. After the conversion, it is replaced by B7 0D 0A. In other words, 7C (which is "|") is replaced by 0D 0A, which is a line break...

manusse
2nd January 2007, 19:33
It seems SubtitleCreator is handling your file well.

Cheers
Manusse

BigCondor
3rd January 2007, 07:37
The problem also appears in some players during playing. Character such as "四" also has the same issue. After I use ViPlay the problem was gone. Subtitle workshop can handle srt files very well, so why bother to use MicroDVD format? I think the format will eventually faint out.

helge79
3rd January 2007, 12:26
It seems SubtitleCreator is handling your file well.
Yes, that program seems to be all right. Thank you very much for pointing it out!

Still, a bunch of other subtitle software seems to be affected by the bug. If you know of any efficient way to spread this bug report and make it reach (at least some of) the developers, it would be really nice to do so.