Validation logic is incorrect for non-english languages #264

The length of non-english strings is calculated incorrectly. At least for the UTF-8 encoding (qcubed default). tested on the russian language.