always compare strings, don't try to convert to number (bnc #885653)

This check seems to be the origin of the original problem: ```endptr``` is set to the next character in ```str``` after the numerical value, thus if the string starts with a number ```data != endptr```. The correct check is ```*endptr == L'\0'``` (and using ```c_str()``` instead of ```data()```) thus checking if if the complete string could be converted.