Opened 12 years ago

Closed 11 years ago

#3539 closed defect (fixed)

Recording program to a recgroup containing ä/ö characters, corrupts the recording group name

Reported by: otto at kolsi dot fi Owned by: stuartm
Priority: blocker Milestone: 0.21
Component: mythtv Version: head
Severity: low Keywords: recording group, UTF8
Cc: Ticket locked: no

Description

If recording group name contains e.g. characters 'ä', or 'ö', when you schedule and record a program to this recording group the group name gets corrupted in DB (table 'recorded', column 'recgroup'.

End result is that if you scheduled a recording to 'Metsästys' group, when it is recorded, there is a group like 'MetsŤstys'. There's probably just one .toUtf8() / .fromUtf8() type of call missing somewhere where recording info is stored to DB.

Other than this, recgroups containing other than plain ASCII characters seem to work fine (in playback, in MythWeb etc.).

Attachments (2)

recgroup-utf8.patch (694 bytes) - added by otto at kolsi dot fi 12 years ago.
recgroup_utf8.diff (1.4 KB) - added by stuartm 12 years ago.

Download all attachments as: .zip

Change History (17)

Changed 12 years ago by otto at kolsi dot fi

Attachment: recgroup-utf8.patch added

comment:1 Changed 12 years ago by otto at kolsi dot fi

Attached a patch that fixes the issue by removing one .utf8() call.

I've tried to verify that this doesn't brake anything by recording various shows to recgroups with names containing non-ascii and just ascii characters.

comment:2 Changed 12 years ago by stuartm

Milestone: unknown0.21
Owner: changed from Isaac Richards to stuartm
Type: defectpatch

comment:3 Changed 12 years ago by stuartm

My concern is that we have obviously pulled the recgroup name from the database somewhere without converting it to unicode - which goes against what we do with every other text string. Although it might mean more changes, the correct way to handle the problem would be to find where we've missed .fromUTF8()

I'm wondering why we are passing around recgroup as a string anyway - using a numeric id is much safer and makes changing things like the recgroup name much easier. Perhaps we need to setup a recgroup table indexing the recgroups by an id, storing the name and password (replacing recgrouppassword).

comment:4 in reply to:  3 Changed 12 years ago by otto at kolsi dot fi

Replying to stuartm:

My concern is that we have obviously pulled the recgroup name from the database somewhere without converting it to unicode - which goes against what we do with every other text string. Although it might mean more changes, the correct way to handle the problem would be to find where we've missed .fromUTF8()

I thought exactly the same, should have mentioned that in the ticket. I very briefly tried to find the place where we pull out the recgroup from the database and that seemed to have the correct .fromUTF8() call in place. But I could have (and obviously did) missed something.

If anyone else is having this problem, original patch can be used as a workaround but as you said, it's better to fix the initial cause of the problem.

comment:5 Changed 12 years ago by stuartm

Type: patchtask

Changed 12 years ago by stuartm

Attachment: recgroup_utf8.diff added

comment:6 Changed 12 years ago by stuartm

Otto could you try the patch I've attached? I don't have time right now to convert everywhere that uses recgroup to use a numeric id and even if I started, I'd then have to do the same for the playgroup, storagegroups and a dozen other things. So I've just made sure that we are converting recgroup to unicode when pulling it from the database.

comment:7 Changed 12 years ago by stuartm

Resolution: fixed
Status: newclosed

(In [14119]) Make sure recgroup is converted to unicode after being loaded from the database.

Fixes #3539

comment:8 Changed 11 years ago by otto at kolsi dot fi

Resolution: fixed
Status: closednew

This issue in fact has not been fixed, I somehow wrongly tested it earlier. Here is additional steps to reproduce this problem:

  • take existing recording and assign it to a new recgroup named e.g. TEST-ü (containing any non-ascii character)
  • verify that so far recgroup is shown correctly
  • go and schedule recording and set it to record to this new test group
  • when recording starts, go to Watch Recordings -> there's an additional recgroup with corrupted name: TEST-Ã1/4

comment:9 Changed 11 years ago by stuartm

Status: newaccepted

comment:10 Changed 11 years ago by stuartm

Priority: minorblocker
Status: acceptedstarted

comment:11 Changed 11 years ago by stuartm

Type: taskdefect

comment:12 Changed 11 years ago by stuartm

(In [16032]) A few Utf8 fixes for storagegroups, recgroups and playgroups.

Refs #3539

comment:13 Changed 11 years ago by stuartm

(In [16051]) More UTF8() fixes on recgroup, storagegroup and playgroup names.

Refs #3539

comment:14 Changed 11 years ago by stuartm

Status: startedinfoneeded

Otto, can you update and see if any of the fixes I've committed help? I'd also appreciate it if someone can test storage and playgroup handling of non-ascii characters or report any other areas which fail to work.

comment:15 Changed 11 years ago by stuartm

Resolution: fixed
Status: infoneededclosed
Note: See TracTickets for help on using tickets.