Index: /trunk/ccl/lib/macros.lisp
===================================================================
--- /trunk/ccl/lib/macros.lisp	(revision 5295)
+++ /trunk/ccl/lib/macros.lisp	(revision 5296)
@@ -1576,4 +1576,20 @@
 (defmacro with-cstrs (speclist &body body)
    (with-specs-aux 'with-cstr speclist body))
+
+(defmacro with-encoded-cstr (encoding-name (sym string &optional start end)
+                                 &rest body &environment env)
+  (let* ((encoding (get-character-encoding encoding-name))
+         (str (gensym)))
+    (multiple-value-bind (body decls) (parse-body body env nil)
+      `(let* ((,str ,string))
+        (%stack-block ((,sym (cstring-encoded-length-in-bytes ,encoding ,str ,start ,end) :clear t))
+          ,@decls
+          (encode-string-to-memory ,encoding ,sym 0 ,str ,start ,end)
+          ,@body)))))
+
+(defmacro with-encoded-cstrs (encoding-name bindings &body body)
+  (with-specs-aux 'with-encoded-cstr (mapcar #'(lambda (b)
+                                                 `(,encoding-name ,b))
+                                             bindings) body))
 
 
