encode_cstring fix for longs and int