[Bug 740784] subparse: fails to detect UTF-8 encoding

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Wed Dec 3 06:24:02 PST 2014


https://bugzilla.gnome.org/show_bug.cgi?id=740784
  GStreamer | gst-plugins-base | git

Tim-Philipp Müller <t.i.m> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #291949|none                        |reviewed
             status|                            |

--- Comment #15 from Tim-Philipp Müller <t.i.m at zen.co.uk> 2014-12-03 14:23:54 UTC ---
(From update of attachment 291949)
Thanks for the patch! I don't think it's really right though.

>   /* Otherwise check if it's UTF8 */
>   if (self->valid_utf8) {
>+    while (len > 0 && str[len] == '\0') --len;

This is an off-by-one, no?

>     if (g_utf8_validate (str, len, NULL)) {
>       GST_LOG_OBJECT (self, "valid UTF-8, no conversion needed");
>+      self->detected_encoding = g_strdup ("UTF-8");

I don't think this is correct. Example:

First string: "Hello!"
Second: "My name is $iso_8859_15_characters".

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the gstreamer-bugs mailing list