X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Foctets.lisp;h=247f685798a5c5942ff2a9bddda5259796f1eeaa;hb=71766d9db05e93567cb7e829abfc675c3cb895c9;hp=e768fb3a7d12882dbe7ff414d8a0990e079b88cb;hpb=1363121ddb1d2e722e2e41d1c93758551066797c;p=sbcl.git diff --git a/src/code/octets.lisp b/src/code/octets.lisp index e768fb3..247f685 100644 --- a/src/code/octets.lisp +++ b/src/code/octets.lisp @@ -641,19 +641,38 @@ one-past-the-end" (defun default-external-format () (or *default-external-format* - (let ((external-format (intern (or #!-win32 (sb!alien:alien-funcall - (extern-alien - "nl_langinfo" - (function c-string int)) - sb!unix:codeset) - "LATIN-1") - "KEYWORD"))) + ;; On non-unicode, use iso-8859-1 instead of detecting it from + ;; the locale settings. Defaulting to an external-format which + ;; can represent characters that the CHARACTER type can't + ;; doesn't seem very sensible. + #!-sb-unicode + (setf *default-external-format* :latin-1) + (let ((external-format #!-win32 (intern (or (sb!alien:alien-funcall + (extern-alien + "nl_langinfo" + (function (c-string :external-format :latin-1) + int)) + sb!unix:codeset) + "LATIN-1") + "KEYWORD") + #!+win32 (sb!win32::ansi-codepage))) (/show0 "cold-printing defaulted external-format:") #!+sb-show (cold-print external-format) (/show0 "matching to known aliases") (dolist (entry *external-formats* (progn + ;;; FIXME! This WARN would try to do printing + ;;; before the streams have been initialized, + ;;; causing an infinite erroring loop. We should + ;;; either print it by calling to C, or delay the + ;;; warning until later. Since we're in freeze + ;;; right now, and the warning isn't really + ;;; essential, I'm doing what's least likely to + ;;; cause damage, and commenting it out. This + ;;; should be revisited after 0.9.17. -- JES, + ;;; 2006-09-21 + #+nil (warn "Invalid external-format ~A; using LATIN-1" external-format) (setf external-format :latin-1)))