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
Support UTF-8 Encoded M3U Playlists #21992
Conversation
Out of curiosity. Is there really a need for the advanced setting? Could we just not go to the m3u8 and call it a day? You mention sharing with "legacy" apps, if users wanted/needed that, could they not just curate their m3u lists in some other tool, and then that m3u list can be imported into kodi, but that same list can be used for their "legacy" app. My query really stems from the "another advanced setting" standpoint. |
@fuzzard Yes, I am fine with removing the advanced setting if you think it is not warranted. I would assume most people that create playlists within Kodi don't intend to share them with other players, anyway. |
Cool, hold off on the work though, i was just throwing out a thought really. Maybe @DaveTBlake or @the-black-eagle can chime in from a Music perspective inside kodi. |
I can just say from my perspective, m3u/m3u8 files relate to filenames, so if a device/software can't handle utf-8 in m3u it probably can't handle the filenames either. But as it exists m3u files created in Kodi are worthless for me in Kodi or any other device since all unicode outside of latin1 or cp437 are replaced with spaces. |
@complexlogic if you have time, lets go ahead with dropping the advanced setting. We'll just go with saving m3u8 by default regardless. I know other devs have been trying to bring more natural unicode support into other areas, so this is an easy win with minimal downsides. |
@fuzzard I just made the following changes:
Please let me know if anything further is required. |
I've made some formatting changes to meet the current code style. The diffs are available in the following links: For more information please see our current code style guidelines. |
bool utf8 = false; | ||
if (URIUtils::GetExtension(strFileName) == ".m3u8") | ||
utf8 = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is appropriate to be inline
bool utf8 = false; | |
if (URIUtils::GetExtension(strFileName) == ".m3u8") | |
utf8 = true; | |
bool isUtf8 = URIUtils::GetExtension(strFileName) == ".m3u8"; |
bool utf8 = false; | ||
if (URIUtils::GetExtension(strFileName) == ".m3u8") | ||
utf8 = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bool utf8 = false; | |
if (URIUtils::GetExtension(strFileName) == ".m3u8") | |
utf8 = true; | |
bool isUtf8 = URIUtils::GetExtension(strFileName) == ".m3u8"; |
Thanks for the PR @complexlogic . we'll merge early for v21, and see if any issues come up. |
Description
This PR adds support for UTF-8 encoded M3U playlists with file extension
.m3u8
.Current Behavior
Kodi can read UTF-8 encoded data in an M3U playlist created by another program, but only for the
.m3u
file extension, not.m3u8
. The bigger issue is with the playlist editing feature. When saving a playlist, Kodi strips out any characters that are not in the locale's default non-Unicode encoding. This means that any files with paths that contain Unicode characters can't be played back, even though Kodi never raised any errors when the playlist was saved.Proposed Implementation
Write M3U8 format by default for all new playlists. When editing existing playlists, preserve its file extension.
Motivation and context
This has been a longstanding issue and feature request. See the following:
How has this been tested?
.m3u8
.m3u
playlist does not convert it to.m3u8
What is the effect on users?
Feature request is implemented. See Motivation and context section
Screenshots (if appropriate):
N/A
Types of change
Checklist: