Replacing functions deprecated in Qt5

This commit replaces deprecated toAscii() and fromAscii() with
toLatin1() and fromLatin1()