I'm doubting if we shoild domthat as this is in fact a bug in the source... This should be solved at handbrake. Also vlc should habe issues with that extra space!
Well believe me i've been in a discussion with the handbrake guys. The won't change it.
But I now have the real reason.
At start older days the ssa codec indeed could not have \N \h signs.
But since that like a lot of stuff the ssa codec has been extended, to support these signe that's actually the ass tag extention.
So handbrake makes now use off advanced sub station alpha and then yes \N is allowed.
http://docs.aegisub.org/3.2/ASS_Tags/
Ok this advanced tag signs are there already longer. gstreamer did solved it with code routine in gstssaparse.c: of plugins-base subbparse
static gboolean gst_ssa_parse_remove_override_codes (GstSsaParse * parse, gchar * txt) { gchar *t, *end; gboolean removed_any = FALSE; while ((t = strchr (txt, '{'))) { end = strchr (txt, '}'); if (end == NULL) { GST_WARNING_OBJECT (parse, "Missing { for style override code"); return removed_any; } /* move terminating NUL character forward as well */ memmove (t, end + 1, strlen (end + 1) + 1); removed_any = TRUE; } /* these may occur outside of curly brackets. We don't handle the different * wrapping modes yet, so just remove these markers from the text for now */ while ((t = strstr (txt, "\\n"))) { t[0] = ' '; t[1] = '\n'; } while ((t = strstr (txt, "\\N"))) { t[0] = ' '; t[1] = '\n'; } while ((t = strstr (txt, "\\h"))) { t[0] = ' '; t[1] = ' '; } return removed_any; }
Other programs then handbrake already used it , some official media has even been made with those ssa/ass tags for the internal subtitle codecs.
Ok this has been done to solve a error with this \N into c and c++ text strings.
Somehow gstreamer provides a valid base. to work further with it into c and c++ but with an unwanted side effect:
- it ads a white space at each end off line.
- the txt line end string trailing edge (string line end) is not removed. Which indeed results in a still very valid c or c++ string a space at the end of line is not invalid we just do not like it or wan't it a trailing edge \n newline is also valid in c/c++ strings . we do not wan't it.
here extra debug code with also the base parsing by gstreamer self.