Wrong Chapter Markers on svn6207

Archive of historical bug reports.
Please use the GitHub link above to report issues.
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.

*******************************
Post Reply
Iosue
Posts: 46
Joined: Wed Mar 05, 2014 3:01 am

Wrong Chapter Markers on svn6207

Post by Iosue »

I imported the markers from this cvs file:

1,\
2,序曲
3,第1乐章 Allegro energico\,ma non troppo. Heftig\, aber markig
4,第2乐章 Scherzo.Wuchtig
5,第3乐章 Andante moderato
6,第4乐章 Finale\, Andante moderato–Allegro energico

But it is converted into something like this:
Image
Top: Original csv, in case the forum doesn't support the encoding.
Bottom: Chapter Markers seen in iTunes
Iosue
Posts: 46
Joined: Wed Mar 05, 2014 3:01 am

Re: Wrong Chapter Markers on svn6207

Post by Iosue »

I am happy to see it tempered in svn6210. But then, something still doesn't come right.

1. When the cvs is imported, all the stuff after the commas are cut off. Manually putting the stuff back works fine.
2. The chapter markers display properly in The KMPlayer (although the player always mistake chapter markers as subtitles), but not in iTunes.
TedJ
Veteran User
Posts: 5388
Joined: Wed Feb 20, 2008 11:25 pm

Re: Wrong Chapter Markers on svn6207

Post by TedJ »

Iosue wrote:I am happy to see it tempered in svn6210. But then, something still doesn't come right.

1. When the cvs is imported, all the stuff after the commas are cut off. Manually putting the stuff back works fine.
What does the C in CSV stand for? Make sure you're escaping any embedded commas with a backslash.
Iosue
Posts: 46
Joined: Wed Mar 05, 2014 3:01 am

Re: Wrong Chapter Markers on svn6207

Post by Iosue »

TedJ wrote:
Iosue wrote:I am happy to see it tempered in svn6210. But then, something still doesn't come right.

1. When the cvs is imported, all the stuff after the commas are cut off. Manually putting the stuff back works fine.
What does the C in CSV stand for? Make sure you're escaping any embedded commas with a backslash.
All the commas are escaped. The file was exported by Handbrake and all commas are already there. When Handbrake imports this file back, the lines becomes like this:

1,\
2,序曲
3,第1乐章 Allegro energico\ <------ cut off there
4,第2乐章 Scherzo.Wuchtig
5,第3乐章 Andante moderato
6,第4乐章 Finale\ <------ cut off there

And the characters still look like the iTunes screenshot, except chapters 1, 2 and 4 now display a correct entry, just incorrectly encoded.
Woodstock
Veteran User
Posts: 4623
Joined: Tue Aug 27, 2013 6:39 am

Re: Wrong Chapter Markers on svn6207

Post by Woodstock »

TedJ wrote:What does the C in CSV stand for? Make sure you're escaping any embedded commas with a backslash.
Actually, any value that contains a comma should be wrapped in quotes, and any quotes within a value escaped by doubling it. If the library that is exporting the CSV changed a comma to "\,", then it's not a particularly compliant library...

This would be a more standard way of representing the list in CSV:

Code: Select all

2,序曲
3,"第1乐章 Allegro energico,ma non troppo. Heftig, aber markig"
4,第2乐章 Scherzo.Wuchtig
5,第3乐章 Andante moderato
6,"第4乐章 Finale, Andante moderato–Allegro energico"
(I deal with dozens of variants of CSV every week at work)
Iosue
Posts: 46
Joined: Wed Mar 05, 2014 3:01 am

Re: Wrong Chapter Markers on svn6207

Post by Iosue »

It is also possible to have a " in these markers. Do you suggest using "" or \"?
Besides, I think using Regular Expression to capture it would also be fine, like
[0-999], (.*?)\r\n

Besides, there are also problems on parsing these non-Latin words there. It worked fine with 0.9.9.1. Maybe we need to do it with Unicode?
Woodstock
Veteran User
Posts: 4623
Joined: Tue Aug 27, 2013 6:39 am

Re: Wrong Chapter Markers on svn6207

Post by Woodstock »

The most usual way of encoding a " character is to double it up, i.e.:

Code: Select all

2,序曲
3,"第1乐章 Allegro energico,ma ""non troppo"". Heftig, aber markig"
4,第2乐章 Scherzo.Wuchtig
5,第3乐章 Andante moderato
6,"第4乐章 Finale, Andante moderato–Allegro energico"
I have not seen \" used in any of the systems I've encountered, but, I have not seen everything out there.
Iosue
Posts: 46
Joined: Wed Mar 05, 2014 3:01 am

Re: Wrong Chapter Markers on svn6207

Post by Iosue »

I haven't either. But Regular Expression seems to cover it all.
Post Reply