bugfix - fixes utf8 exception in detect_paper_name#1492
bugfix - fixes utf8 exception in detect_paper_name#1492aw-cloud wants to merge 1 commit intoahrm:developmentfrom
Conversation
utf8_decode called from detect_paper_name can throw, in particular when given invalid utf8. Adds a try / catch block in the calling function to account for this possibility. Behaviour is that invalid utf8 causes the paper name to be left blank and an error message is logged to stderr.
|
Thanks. I am not a huge fan of ? |
|
Changing If using those replacement characters is safe then you can switch to |
|
Couldn't you just throw replacement characters instead? Shouldn't be any crashes if you do that. return QString::fromUtf8(buffer, strlen(buffer)).toStdWString(); That way no try or catches |
Fixes #1411
utf8_decodecalled fromdetect_paper_namecan throw, in particular when given invalid utf8. Adds a try / catch block in the calling function to account for this possibility. Behaviour is that invalid utf8 causes the paper name to be left blank and an error message is logged to stderr.