Replaced deprecated toAscii with toLatin1 method.