After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 555257 - Doesn't display srt subtitles saved with BOM
Doesn't display srt subtitles saved with BOM
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.10.20
Other All
: Normal normal
: 0.10.22
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 554721
 
 
Reported: 2008-10-06 16:12 UTC by Jani Uusitalo
Modified: 2008-10-10 17:12 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
Subrip subtitle (one line of text); UTF-8 with BOM (50 bytes, text/plain)
2008-10-10 16:27 UTC, Jani Uusitalo
Details

Description Jani Uusitalo 2008-10-06 16:12:40 UTC
Please describe the problem:
Subtitles in a UTF-8 encoded .srt file with a byte-order mark are not shown by Totem.

Steps to reproduce:
1. Enable automatic loading of subtitles in Totem.
2. Load a working subtitle file into Gnome Subtitles.
2. Save the subtitles using the same file name, choose UTF-8 for encoding.
3. In Totem, open the video associated with the subtitle file.


Actual results:
Totem does not display the subtitles on top of the video.

Expected results:
Totem to show the subtitles on top of the video.

Does this happen every time?
Yes.

Other information:
I initially filed this against Gnome Subtitles (bug 554721).
Comment 1 Sebastian Dröge (slomo) 2008-10-10 15:34:29 UTC
UTF-8 files should not have a BOM at the beginning AFAIK, it's only for UTF-16 and UTF-32. Nonetheless, could you attach such subtitle file to this bug?
Comment 2 Jani Uusitalo 2008-10-10 16:27:17 UTC
Created attachment 120344 [details]
Subrip subtitle (one line of text); UTF-8 with BOM
Comment 3 Sebastian Dröge (slomo) 2008-10-10 17:12:18 UTC
2008-10-10  Sebastian Dröge  <sebastian.droege@collabora.co.uk>

	* gst/subparse/gstsubparse.c:
	(gst_sub_parse_data_format_autodetect), (handle_buffer),
	(gst_sub_parse_change_state):
	* gst/subparse/gstsubparse.h:
	* tests/check/elements/subparse.c: (GST_START_TEST):
	Add support for subtitle files with UTF-8 BOM at the beginning
	by simple stripping it from the first line before passing it
	to any parsing code. Fixes bug #555257 and playback of files
	created by Gnome Subtitles.