Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subtitles: allow self-closing br and html escape characters #10813

Merged
merged 2 commits into from Nov 1, 2016

Conversation

Projects
None yet
5 participants
@Rechi
Copy link
Member

commented Oct 30, 2016

Description

Allows to have self-closing br tags in subtitles and also decode html escape characters.

Motivation and Context

Without this change subtitles with e.g. & in their file would show & in kodi instead of just &.

How Has This Been Tested?

runtime tested

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the Code guidelines of this project
  • My change requires a change to the documentation, either Doxygen or wiki
  • I have updated the documentation accordingly
  • I have read the CONTRIBUTING document
  • I have added tests to cover my change
  • All new and existing tests passed

@Rechi Rechi changed the title Subtitles Subtitles: allow self-closing br and html escape characters Oct 30, 2016

@@ -196,6 +198,11 @@ void CDVDSubtitleTagSami::ConvertLine(CDVDOverlayText* pOverlay, const char* lin
if( strUTF8[strUTF8.size()-1] == '\n' )
strUTF8.erase(strUTF8.size()-1);

std::wstring wStrHtml, wStr;
g_charsetConverter.utf8ToW(strUTF8, wStrHtml);
HTML::CHTMLUtil::ConvertHTMLToW(wStr, wStr);

This comment has been minimized.

Copy link
@Uukrull

Uukrull Oct 31, 2016

Contributor

Typo?
ConvertHTMLToW(wStrHtml, wStr);

@Rechi Rechi force-pushed the Rechi:subtitles branch from 0d36b3e to 56ff2ab Oct 31, 2016

@Rechi

This comment has been minimized.

Copy link
Member Author

commented Oct 31, 2016

updated a typo

@hudokkow

This comment has been minimized.

Copy link
Member

commented Oct 31, 2016

@FernetMenta

This comment has been minimized.

Copy link
Member

commented Nov 1, 2016

+1 but I can't say much about this function. we have to trust @Rechi

@MartijnKaijser

This comment has been minimized.

Copy link
Member

commented Nov 1, 2016

jenkins build this please

@MartijnKaijser MartijnKaijser merged commit 3ecd856 into xbmc:master Nov 1, 2016

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins4kodi You did a great job. Have a cookie.
Details

@Rechi Rechi deleted the Rechi:subtitles branch Nov 1, 2016

@MartijnKaijser

This comment has been minimized.

Copy link
Member

commented Nov 6, 2016

@Rechi this broken RTL subtitle languages like Hebrew
http://forum.kodi.tv/showthread.php?tid=269814&pid=2450426#pid2450426
http://forum.kodi.tv/showthread.php?tid=269814&pid=2451019#pid2451019

Please look into this else we'll have to revert this PR.

@Rechi

This comment has been minimized.

Copy link
Member Author

commented Nov 6, 2016

@MartijnKaijser Just reverting 56ff2ab should be enough.
I think converting from UTF8 to wide an back to UTF8 again is the problem, but there exists no method which converts HTML to UTF8 directly.

@MartijnKaijser

This comment has been minimized.

Copy link
Member

commented Nov 7, 2016

See
#10885 for revert

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.