concerto / concerto-remote-video

Core Concerto plugin for remote video sources
Other
6 stars 7 forks source link

Youtube video generates mySQL error #43

Closed mzocher closed 5 years ago

mzocher commented 6 years ago

When attempting to submit a specific Youtube video in Concerto, I received the following error:

Mysql2::Error: Incorrect string value: '\xE2\x80\x8B\xE2\x80\x8B...' for column 'data' at row 1: INSERT INTO contents (type, name, duration, start_time, end_time, kind_id, user_id, data, created_at, updated_at) VALUES ('RemoteVideo', 'OneDrive Intro', 104, '2018-02-19 08:00:00', '2018-03-10 07:59:00', 1, 1, '{\"video_vendor\":\"YouTube\",\"video_id\":\"bWqtS-L-t5k\",\"allow_flash\":\"0\",\"title\":\"This is OneDrive\",\"description\":\"This video shows how OneDrive is leading with innovation to make sharing and file management easier in the cloud with Office 365.​​\n\nLearn more: http://onedrive.com/business\",\"duration\":104,\"preview_url\":\"//www.youtube.com/embed/bWqtS-L-t5k\",\"preview_code\":\"<iframe src=\\"//www.youtube.com/embed/bWqtS-L-t5k\\" frameborder=\\"0\\" allowfullscreen=\\"allowfullscreen\\">\",\"thumb_url\":\"https://i.ytimg.com/vi/bWqtS-L-t5k/hqdefault.jpg\",\"video_available\":true}', '2018-02-15 04:02:21', '2018-02-15 04:02:21')

mzocher commented 5 years ago

Ok, I forgot I submitted this long ago. I determined my database was created with latin1 encoding, not utf8. The problem isn't unique to the concerto-remote-video plugin, and happens with the ticker submissions too. It all stems back to how the database is created, so I'm closing this ticket and have opened a ticket for the concerto-debian project (that created the installer).

Depending on your need and amount of content, migrating to utf8 might be the best step forward: https://www.a2hosting.com/kb/developer-corner/mysql/convert-mysql-database-utf-8 Another option (not ideal) might be to modify your database.yml file and change encoding: utf8 to the older encoding: latin1