Opened 11 years ago

Closed 11 years ago

#5817 closed task (fixed)

Mytharchive 0.22 problem

Reported by: martin@… Owned by: paulh
Priority: minor Milestone: unknown
Component: mytharchive Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description (last modified by paulh)

I got this error and cant find any solution at all. I now that it is something to do with the charset, i do not give this error if I do not use the TV guide, and instead try to burn a manual recordings, whith no special character.

2008-10-12 18:29:36 mythburn.py (0.1.20080726-1) starting up...
2008-10-12 18:29:36 Found 1 CPUs
2008-10-12 18:29:36 Obtaining MythTV settings from MySQL database for hostname schmidt-thomsen.dk
2008-10-12 18:29:36 temppath: /Data1/video/work
2008-10-12 18:29:36 logpath:  /Data1/video/logs
2008-10-12 18:29:36 Setting process priority to 10
2008-10-12 18:29:36 Processing Mythburn job number 1.
2008-10-12 18:29:36 Options - mediatype = 2, doburn = 1, createiso = 0, erasedvdrw = 1
2008-10-12 18:29:36           savefilename = ''
2008-10-12 18:29:36 Looking for: /usr/share/mythtv/mytharchive/themes/Simple_-_Autoplay/theme.xml
2008-10-12 18:29:36 Loading font 0, /usr/share/mythtv/FreeSans.ttf size 23
2008-10-12 18:29:36 Loading font 1, /usr/share/mythtv/FreeSans.ttf size 18
2008-10-12 18:29:36 Loading font 2, /usr/share/mythtv/FreeSans.ttf size 16
2008-10-12 18:29:36 wantIntro: 0, wantMainMenu: 0, wantChapterMenu:0, wantDetailsPage: 0
2008-10-12 18:29:36 Final DVD Video format will be pal
2008-10-12 18:29:36 There are 1 files to process
2008-10-12 18:29:36 Pre-processing recording 1: '/Data1/mythtv/standard/1724_20080929225000.nuv'
2008-10-12 18:29:37           Er jeg stadig gak gak mor?
2008-10-12 18:29:37 ------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/share/mythtv/mytharchive/scripts/mythburn.py", line 5429, in main
    processJob(job)
  File "/usr/share/mythtv/mytharchive/scripts/mythburn.py", line 5131, in processJob
    preProcessFile(node,folder,filecount)
  File "/usr/share/mythtv/mytharchive/scripts/mythburn.py", line 1794, in preProcessFile
    getFileInformation(file, folder)
  File "/usr/share/mythtv/mytharchive/scripts/mythburn.py", line 1525, in getFileInformation
    node.appendChild(infoDOM.createTextNode(unicode(record[5], "UTF-8")))
  File "/usr/lib/python2.5/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 8-10: invalid data
2008-10-12 18:29:37 ------------------------------------------------------------

Please help me I have deal with this problem i a hole week now.

Attachments (1)

mythburnutf8.diff (4.3 KB) - added by Bjorn Gustafsson <bjorne-g@…> 11 years ago.
Patch to mythburn to make sure all data is read from database using utf8

Download all attachments as: .zip

Change History (11)

comment:1 Changed 11 years ago by paulh

Description: modified (diff)

comment:2 Changed 11 years ago by paulh

Does the program information show OK in Myth?

If those line numbers are correct it looks like the subtitle for that recording has some bad characters that cannot be converted from UTF8.

comment:3 Changed 11 years ago by Martin

Thanks for your reply! I think my problem is that I am from denmark:) I grab the tvguide from some danish site's and there is is some danish charracters(ÆØÅ) if I make a manuel recording and make sure only to use standard carecters It do not get this error.

comment:4 Changed 11 years ago by paulh

MythArchive? should work OK with Danish characters if it is encoded correctly. It gets the program information from the database record for the recording the same one Myth uses to display the program information on various screens. The reason I asked you if it was working OK in Myth is to eliminate any possibility the information in the database is encoded wrongly. If it works OK in Myth then it's a problem with the way MythArchive? is decoding the utf8 from the DB. If it isn't displayed properly in Myth then the problem is with either your epg grabber or mythfilldatabase.

So does the program information display correctly in Myth?

One thing you could try is to edit the program information passed to MythArchive?. On the screen in MythArchive? where you select the files to add to the DVD if you press 'M' or MENU there is an option to edit the program information.

comment:5 Changed 11 years ago by Martin

Thanks for your reply It does help to change the title to standard characters, it ok but it would be nice if there was a better solution.

comment:6 Changed 11 years ago by Dibblah

Status: newassigned

Changed 11 years ago by Bjorn Gustafsson <bjorne-g@…>

Attachment: mythburnutf8.diff added

Patch to mythburn to make sure all data is read from database using utf8

comment:7 in reply to:  6 Changed 11 years ago by Bjorn Gustafsson <bjorne-g@…>

Replying to Dibblah: I have attached a patch that fixes my problem with local (swedish) characters in title and subtitle.

comment:8 Changed 11 years ago by Janne Grunau

does adding init_command='SET NAMES utf8' alone works as well

from mysql standpoint it should be enough?

comment:9 in reply to:  8 Changed 11 years ago by Bjorn Gustafsson <bjorne-g@…>

Replying to janne:

does adding init_command='SET NAMES utf8' alone works as well

from mysql standpoint it should be enough?

You are right, adding the init_command alone fixes my problem.

comment:10 Changed 11 years ago by paulh

Resolution: fixed
Status: assignedclosed

(In [19490]) Make sure the DB connection used for all queries in mythburn.py is using utf8. Fixes #5817.

Note: See TracTickets for help on using tickets.