Raymond Toy pushed to branch issue-139-set-terminal-to-utf8 at cmucl / cmucl
Commits: 29bc9639 by Raymond Toy at 2022-11-25T21:39:24-08:00 Use stream::find-external-format to determine the formats
The `:locale` format can be set to an alias, which itself is an alias. We want to use the final underlying format so use `stream::find-external-format` to do that and extract the name from that to use as the alias for `:locate`.
- - - - - ed90e7e0 by Raymond Toy at 2022-11-26T06:54:32-08:00 Use stream::find-external-format to determine the formats
The `:locale` format can be set to an alias, which itself is an alias. We want to use the final underlying format so use `stream::find-external-format` to do that and extract the name from that to use as the alias for `:locate`.
- - - - -
1 changed file:
- src/code/save.lisp
Changes:
===================================== src/code/save.lisp ===================================== @@ -152,13 +152,15 @@ (setf (gethash :locale stream::*external-format-aliases*) *default-external-format*)) (t - (let ((codeset-format (intern codeset "KEYWORD"))) - ;; If we know the format, we can set the alias. - ;; Otherwise, print a warning and use :iso8859-1 as the + ;; If we know the format. This could be an alias to + ;; another format and so on, so use FIND-EXTERNAL-FORMAT + ;; to determine the final format and use that as the ;; alias. + (let* ((codeset-format (intern codeset "KEYWORD")) + (final-format (stream::find-external-format codeset-format))) (setf (gethash :locale stream::*external-format-aliases*) - (if (stream::find-external-format codeset-format nil) - codeset-format + (if final-format + (stream::ef-name final-format) (progn (warn "Unsupported external format; using :iso8859-1 instead: ~S" codeset-format)
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/967f32851d4f265a2fc0b96...