I am not sure if it's a portable way to convet wide characters to numbers.