[Openmcl-devel] encoding/decoding clozure strings to/from UTF-8

R. Matthew Emerson rme at clozure.com
Tue Dec 30 10:46:03 PST 2014


> On Dec 30, 2014, at 1:19 PM, Mark Klein <m_klein at MIT.EDU> wrote:
> 
> 
> I have Clozure 1.10 running on a Mac (OS 10.10.1). I'd like to be able to encode strings to and from UTF-8 (to handle multi-language text in a web application I am developing). Can someone give me some pointers on how I can do that?

http://ccl.clozure.com/docs/ccl.html#encoding-and-decoding-strings

Basically, use (encode-string-to-octets string :external-format :utf-8) to encode a lisp string into a vector of octets containing UTF-8-encoded data, and use (decode-string-from-octets vector :external-format :utf-8) to create a lisp string from a vector of octets containing UTF-8-encoded data.





More information about the Openmcl-devel mailing list