fix #3597, stack overflow printing CharString