1.36 Import TV channel groups: "Invalid character in the given encoding" (1 Viewer)

rsbrux

Documentation Group
  • Team MediaPortal
  • April 15, 2007
    1,152
    127
    Home Country
    Switzerland Switzerland
    Because I have around 200 TV channels and more than a dozen groups, I tried to import the TV channel groups from an old export.xml file. Evidently because one of the channel names contains an umlaut, I got the above mentioned error message. The version I made the export with (probably 1.27) was evidently able to deal with umlauts. Furthermore, the channel list that 1.36 created by scanning the DVB-C cable input contains the same channel name, including the umlaut. Is this a bug? If not, how can I get 1.36 to deal gracefully with imports containing special characters?
     

    CyberSimian

    Test Group
  • Team MediaPortal
  • June 10, 2013
    2,988
    1,860
    Southampton
    Home Country
    United Kingdom United Kingdom
    I tried to import the TV channel groups from an old export.xml file. Evidently because one of the channel names contains an umlaut, I got the above mentioned error message.
    In older releases of MP, TV Server and/or the client TV Plugin had a bug in the handling of code pages. Although characters that were part of the ASCII set displayed correctly, a small number of more-specialised characters displayed incorrectly. Owlsroost fixed this bug sometime in 2018.

    Look at the beginning of the export file to see if there is an xml tag that specifies the code page. Do this for an export file from 1.36, and then compare it with the file that you are trying to import.

    You could try changing the code page specified in the import file to the value specified in the 1.36 export file, but this still does not guarantee that the file will import correctly. So I think that you might have to resort to editing the import file to correct the characters that are causing the problem. Hopefully there will not be too many of these bad characters.

    Once the errors are corrected, you should be able to export and import without problem (but note that I have never tested this as the UK does not have any channel names that contain specialised characters).

    -- from CyberSimian in the UK
     

    rsbrux

    Documentation Group
  • Team MediaPortal
  • April 15, 2007
    1,152
    127
    Home Country
    Switzerland Switzerland
    Thanks for responding. Unfortunately, neither the old export file nor a new one created by 1.36 contains any code page information. In fact, I didn't even try to import the old export.xml file directly. Instead, I copied the "channelgroup" sections from the old export. xml file into a copy of the one created by 1.36.
    The old export.xml file is from 2021, so the fix you refer to should already have been in place.
    Where do you think MP is getting the code page information? How can I even find out what code page MP is assuming?
    For that matter, why does MP even use code pages anymore? Wouldn't UTF be more robust?
    Since 1.36 has already entered the channel names with umlauts into its channel list, I am afraid that editing them out of the channelgroups in the XML file will result in a failure to map them properly to the existing channels in the TV Server DB.
    If I edit the channel names in the TV Server configuration, then they won't match the EPG anymore. Isn't there a more elegant way to handle this?
     
    Last edited:

    CyberSimian

    Test Group
  • Team MediaPortal
  • June 10, 2013
    2,988
    1,860
    Southampton
    Home Country
    United Kingdom United Kingdom
    why does MP even use code pages anymore? Wouldn't UTF be more robust?
    Edit: posted accidentally before complete.

    UTF is a code page (actually, more than one: UTF8, UTF16, UTF32). But I am no expert.

    Your Windows system is using one code page, and your TV provider is using another code page. If these two code pages are different, MP converts text strings such as channel names and EPG information from one code page to the other.

    Sorry, but I don't understand the intricacies of code page handling, or how you can fix your problem. So regrettably I think that you will have to recreate your channel groups by hand. :(

    -- from CyberSimian in the UK
     

    rsbrux

    Documentation Group
  • Team MediaPortal
  • April 15, 2007
    1,152
    127
    Home Country
    Switzerland Switzerland
    According to Wikipedia, Windows only uses code pages other than UTF-8 to support legacy (mostly 32 bit) applications and supports two code pages in addition to UTF-8 (OEM and ANSI). According to Microsoft, UTF-8 has been the preferred character set since 2019. If TV Server (or its import routine) were using UTF-8, then umlauts wouldn't be a problem. Since I haven't encountered this problem before, I suspect that it is a bug in MP TV Server that has been introduced since 2021. As a workaround, I plan to delete from the import file all of the channels with special characters in their names and map those by hand. At least that way I can recover most of my previous mappings.
     

    Users who are viewing this thread

    Top Bottom