proper encoding for memcached message exchange