Next: , Previous: Strings, Up: Strings


*default-foreign-encoding*

Syntax

— Special Variable: *default-foreign-encoding*

Value type

A keyword.

Initial value

:utf-8

Description

This special variable holds the default foreign encoding.

Examples

  CFFI> *default-foreign-encoding*
  :utf-8
  CFFI> (foreign-funcall "strdup" (:string :encoding :utf-16) "foo" :string)
  "f"
  CFFI> (let ((*default-foreign-encoding* :utf-16))
          (foreign-funcall "strdup" (:string :encoding :utf-16) "foo" :string))
  "foo"

See also

Other Types (:string type)
foreign-string-alloc
foreign-string-to-lisp
lisp-string-to-foreign
with-foreign-string
with-foreign-pointer-as-string