Because parse() is used to parsed parameter-like strings. "1" "2" "3" and not 1#2#3. You tried to fix this but in wrong place: replace_all(szData, 255, "#", " ")
This should be executed before calling parse(), or you should save your data in proper format.