SQLite Forum

How to render utf8 with DBI::SQLite

How to render utf8 with DBI::SQLite

(1) By Trudge on 2020-08-16 23:55:37 [link] [source]

Many thanks to those who assisted in my last posting 'Perl backup of database'. The MySQL db has been successfully migrated to SQLite (with some help from sed).

Now I'm working on the web end of it locally. But I'm having issues with utf8 characters in my artist names. I've looked here but found little of use. stackoverflow / exchange is my next option but I thought I'd give you folks a try. Anyone?

'sqlite_unicode => 1' in the connect string doesn't seem to work.

(2) By Stephan Beal (stephan) on 2020-08-17 00:31:23 in reply to 1 [link] [source]

'sqlite_unicode => 1' in the connect string doesn't seem to work.

Presumably you're exporting from mysql to a file via mysqldump, finagling the file, and then importing it to sqlite. If so, first make sure that the export file is indeed utf8. According to:


that might not be the case, depending on how it's exported (search that page for "encoding" for the example they mention, but that page is otherwise pretty bereft of info on the topic).


(3) By Trudge on 2020-08-17 00:49:27 in reply to 2 [link] [source]

Thank you for the quick response. I have managed to solve my problem with the web rendering of utf8 characters. Turns out there was some code in the script from when I used MySQL. Once that code was deleted it worked fine.

However, now I'm having another utf8 issue but with JavaScript. The player I use is JavaScript, and is failing on playing a track if ANY track in the CD contains utf8 characters. The tunnel just got a bit darker.

(4) By Trudge on 2020-08-18 15:19:11 in reply to 2 [source]

I've done some follow-up reading in these articles. Thank you again for that. However, I did the dump via cPanel / phpMyAdmin on my host, so had no control over many options, but one of the Character set options is 'utf-8', which I would have used. So, still a bit dark in the tunnel.