@magict4 It does not matter because, for each encoded string, decode only looks for the first @ char and then read the whole string as a whole: even though the string has @ char in it, it is considered as a part of the string as decoder knows the length of the string.

@StefanPochmann Nice, I thought atoi can only accept the C string ending with \0 character. But the c++ reference says "The string can contain additional characters after those that form the integral number, which are ignored and have no effect on the behavior of this function."