This makes the assumption that the key will be UTF-8 encoded, which isn't a safe assumption: http://fallabs.com/kyotocabinet/ ("Both binary data and character string can be used as a key and a value").