Updated encode() to accept Unicode. (#8)