Raymond Toy pushed to branch issue-139-set-filename-encoding-to-utf8 at cmucl / cmucl
Commits:
2c91358a by Raymond Toy at 2022-12-12T11:10:10-08:00
Load utf16-be format before running test issue.25c
This is a work around until issue #161 is fixed. We had new test that
loads the utf16-be format before running the test `issue.25c`.
- - - - -
1 changed file:
- tests/issues.lisp
Changes:
=====================================
tests/issues.lisp
=====================================
@@ -258,6 +258,13 @@
(assert-equal (map 'list #'char-code out-string)
(map 'list #'char-code expected))))))
+(define-test issue.25c-setup
+ (:tag :issues)
+ ;; Get the external format before running the test issue.25c. See
+ ;; issue #161
+ ;; (https://gitlab.common-lisp.net/cmucl/cmucl/-/issues/161).
+ (assert-true (stream::find-external-format :utf16-be)))
+
(define-test issue.25c
(:tag :issues)
;; Modified test to verify that each octet read from run-program is
@@ -267,9 +274,6 @@
#\greek_small_letter_beta)))
(expected (stream:string-encode in-string :utf16-be))
(path #p"issue25c.txt"))
- ;; Get the external format before opening the file. See issue
- ;; #161 (https://gitlab.common-lisp.net/cmucl/cmucl/-/issues/161).
- (stream::find-external-format :utf16-be)
(with-open-file (s path :direction :output :if-exists :supersede :external-format :utf16-be)
(write-string in-string s)
(force-output s)
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/2c91358a7b87522b3cc8bef…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/2c91358a7b87522b3cc8bef…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-139-set-filename-encoding-to-utf8 at cmucl / cmucl
Commits:
d12d1153 by Raymond Toy at 2022-12-11T09:22:51-08:00
Workaround for test issue.25c
Load the `:utf16-be` format before opening the file with an external
format of `:utf16-be`. Added comment on the underlying issue.
- - - - -
1 changed file:
- tests/issues.lisp
Changes:
=====================================
tests/issues.lisp
=====================================
@@ -267,6 +267,9 @@
#\greek_small_letter_beta)))
(expected (stream:string-encode in-string :utf16-be))
(path #p"issue25c.txt"))
+ ;; Get the external format before opening the file. See issue
+ ;; #161 (https://gitlab.common-lisp.net/cmucl/cmucl/-/issues/161).
+ (stream::find-external-format :utf16-be)
(with-open-file (s path :direction :output :if-exists :supersede :external-format :utf16-be)
(write-string in-string s)
(force-output s)
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/d12d1153d92bc42eb02e06c…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/d12d1153d92bc42eb02e06c…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-139-set-filename-encoding-to-utf8 at cmucl / cmucl
Commits:
689db03d by Raymond Toy at 2022-12-10T11:45:53-08:00
Convert runtime strings to utf-16
The C runtime initializes several variables from either the
environment or the command line. These are, of course, encoded in the
locale, so we need to convert these strings into utf-16 format. Add
`decode-runtime-strings` to do just that.
This problem showed up when installing cmucl in /tmp/αβ and trying to
run lisp. We get an error when printing the herald for the core file
that is being used because we call truename on the path. Since the
path is encoded, we can't find the file. We need to convert the path
to a utf-16 string that we can use.
- - - - -
6720015c by Raymond Toy at 2022-12-10T11:55:03-08:00
Remove lisp:: package specifer
We're in the lisp package, so we don't need the prefix.
- - - - -
234d86a7 by Raymond Toy at 2022-12-10T16:03:53-08:00
Handle decode-runtime-strings and environment more carefully.
`decode-runtime-strings` needs to be more careful in converting the
strings from the C runtime. For the command line parameters and the
environment list, we need to use the locale when converting to Lisp
strings. But `*cmucl-lib*`, `*cmucl-core-path*`, and `*unidata-path*`
needs to use the file encoding to convert the C result to Lisp.
We also need to call `environment-init` after calling
`decode-runtime-strings` because the strings could have changed. This
important for the "library:" search-list which contains file names.
Without this, the search-list is mangled so we can't find anything.
Finally, call `intl::setlocale` after the `environment-init` has been
called again because `intl::setlocale` needs the paths to the pot
files so the "library:" search-list has to be valid pathnames.
Previously, translations could be accessed early and error out because
the paths were not correct.
This was testing by installing in "/tmp/αβ" and running lisp. Before
these changes, we errored out printing out the path to the core file
because the path to the core file was not properly decoded. Now it
works.
Then we tried `(set-system-external-format :euc-kr)`. We can find the
format implementation file correctly.
We also tested with
```
LANG=ko_KR.EUC_KR bin/lisp -noinit
```
This correctly loads up the euc-kr file and sets the external format.
There are no errors. (But of course the printed path for the core
file is wrong because euc-kr can't handle the greek letters.
- - - - -
f43c6517 by Raymond Toy at 2022-12-10T16:26:21-08:00
Add some comments
- - - - -
2 changed files:
- src/code/extfmts.lisp
- src/code/save.lisp
Changes:
=====================================
src/code/extfmts.lisp
=====================================
@@ -493,7 +493,7 @@
;; encoding to NIL because we don't need any special
;; encoding to open the format files.
(let* ((*print-readably* nil)
- (unix::*filename-encoding* nil)
+ ;;(unix::*filename-encoding* nil)
(*package* (find-package "STREAM"))
(lisp::*enable-package-locked-errors* nil)
(s (open (format nil "ext-formats:~(~A~).lisp" name)
=====================================
src/code/save.lisp
=====================================
@@ -164,20 +164,48 @@
*default-external-format*))))
(values))
-
+(defun decode-runtime-strings (locale file-locale)
+ ;; The C runtime can initialize the following strings from the
+ ;; command line or the environment. We need to decode these into
+ ;; the utf-16 strings that Lisp uses.
+ (setf lisp-command-line-list
+ (mapcar #'(lambda (s)
+ (stream:string-decode s locale))
+ lisp-command-line-list))
+ (setf lisp-environment-list
+ (mapcar #'(lambda (s)
+ (stream:string-decode s locale))
+ lisp-environment-list))
+ ;; This needs more work.. *cmucl-lib* could be set from the the envvar
+ ;; "CMUCLLIB" or from the "-lib" command-line option, and thus
+ ;; should use the LOCALE to decode the string.
+ (when *cmucl-lib*
+ (setf *cmucl-lib*
+ (stream:string-decode *cmucl-lib* file-locale)))
+ ;; This also needs more work since the core path could come from the
+ ;; "-core" command-line option and should thus use LOCALE to decode
+ ;; the string. It could also come from the "CMUCLCORE" envvar.
+ (setf *cmucl-core-path*
+ (stream:string-decode *cmucl-core-path* file-locale))
+ ;; *unidata-path* defaults to a pathname object, but the user can
+ ;; specify a path, so we need to decode the string path if given.
+ (when (and *unidata-path* (stringp *unidata-path*))
+ (setf *unidata-path*
+ (stream:string-decode *unidata-path* file-locale))))
+
(defun save-lisp (core-file-name &key
- (purify t)
- (root-structures ())
- (environment-name "Auxiliary")
- (init-function #'%top-level)
- (load-init-file t)
- (site-init "library:site-init")
- (print-herald t)
- (process-command-line t)
- #+:executable
- (executable nil)
- (batch-mode nil)
- (quiet nil))
+ (purify t)
+ (root-structures ())
+ (environment-name "Auxiliary")
+ (init-function #'%top-level)
+ (load-init-file t)
+ (site-init "library:site-init")
+ (print-herald t)
+ (process-command-line t)
+ #+:executable
+ (executable nil)
+ (batch-mode nil)
+ (quiet nil))
"Saves a CMU Common Lisp core image in the file of the specified name. The
following keywords are defined:
@@ -278,13 +306,18 @@
;; Load external format aliases now so we can aliases to
;; specify the external format.
(stream::load-external-format-aliases)
- ;; Set the locale for lisp
- (intl::setlocale)
;; Set up :locale format
(set-up-locale-external-format)
;; Set terminal encodings to :locale and filename encoding to :utf-8.
;; (This needs more work on Darwin.)
(set-system-external-format :locale :utf-8)
+ (decode-runtime-strings :locale :utf-8)
+ ;; Need to reinitialize the environment again because
+ ;; we've possibly changed the environment variables and
+ ;; pathnames.
+ (environment-init)
+ ;; Set the locale for lisp
+ (intl::setlocale)
(ext::process-command-strings process-command-line)
(setf *editor-lisp-p* nil)
(macrolet ((find-switch (name)
@@ -340,14 +373,14 @@
(unix:unix-exit
(catch '%end-of-the-world
(unwind-protect
- (if *batch-mode*
- (handler-case
- (%restart-lisp)
- (error (cond)
- (format *error-output* (intl:gettext "Error in batch processing:~%~A~%")
- cond)
- (throw '%end-of-the-world 1)))
- (%restart-lisp))
+ (if *batch-mode*
+ (handler-case
+ (%restart-lisp)
+ (error (cond)
+ (format *error-output* (intl:gettext "Error in batch processing:~%~A~%")
+ cond)
+ (throw '%end-of-the-world 1)))
+ (%restart-lisp))
(finish-standard-output-streams))))))
;; Record dump time and host
@@ -357,7 +390,7 @@
(let ((initial-function (get-lisp-obj-address #'restart-lisp))
(core-name (unix-namestring core-file-name nil)))
(without-gcing
- #+:executable
+ #+:executable
(if executable
(save-executable core-name initial-function)
(save core-name initial-function #+sse2 1 #-sse2 0))
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/354f94f5be60e66e139a09…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/354f94f5be60e66e139a09…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-139-set-filename-encoding-to-utf8 at cmucl / cmucl
Commits:
1af83384 by Raymond Toy at 2022-12-08T14:57:43+00:00
Address #139: Set terminal format to :locale
- - - - -
6fc2e38e by Raymond Toy at 2022-12-08T14:57:45+00:00
Merge branch 'issue-139-set-terminal-to-utf8' into 'master'
Address #139: Set terminal format to :locale
See merge request cmucl/cmucl!108
- - - - -
7478e387 by Raymond Toy at 2022-12-08T07:04:12-08:00
Merge branch 'master' into issue-139-set-filename-encoding-to-utf8
- - - - -
8367cd33 by Raymond Toy at 2022-12-08T07:26:45-08:00
Fix merge mistake. LANG should not be set.
When merging master, we added LANG again when it should have been
deleted.
- - - - -
fde3634e by Raymond Toy at 2022-12-08T07:31:53-08:00
Set filename encoding to utf-8.
- - - - -
354f94f5 by Raymond Toy at 2022-12-08T07:32:26-08:00
Fix up tests for filename encoding
In test issue.130, we set `*filename-encoding*` to `:utf-8`. This
shouldn't be needed anymore, so remove it.
We also note here the in tests
issue.139-default-external-format-read-file and
issue.139-default-external-format-write-file, we were creating a
pathname consisting of Korean letters. We didn't set the filename
encoding to utf-8 here when opening thes file so I don't know how that
ever worked. But since the encoding is now :utf-8 it should be ok now.
- - - - -
3 changed files:
- bin/run-tests.sh
- src/code/save.lisp
- tests/issues.lisp
Changes:
=====================================
bin/run-tests.sh
=====================================
@@ -47,13 +47,9 @@ function cleanup {
trap cleanup EXIT
-# Set a known value for LANG here so that we can tests consistently.
-# The most important part is that the codeset is UTF-8.
-LANG=en_US.UTF-8
-
if [ $# -eq 0 ]; then
# No args so run all the tests
- $LISP -noinit -load tests/run-tests.lisp -eval '(cmucl-test-runner:run-all-tests)'
+ $LISP -noinit -nositeinit -load tests/run-tests.lisp -eval '(cmucl-test-runner:run-all-tests)'
else
# Run selected files. Convert each file name to uppercase and append "-TESTS"
result=""
@@ -62,6 +58,6 @@ else
new=`echo $f | tr '[a-z]' '[A-Z]'`
result="$result "\"$new-TESTS\"
done
- $LISP -noinit -load tests/run-tests.lisp -eval "(progn (cmucl-test-runner:load-test-files) (cmucl-test-runner:run-test $result))"
+ $LISP -noinit -nositeinit -load tests/run-tests.lisp -eval "(progn (cmucl-test-runner:load-test-files) (cmucl-test-runner:run-test $result))"
fi
=====================================
src/code/save.lisp
=====================================
@@ -145,26 +145,23 @@
(defun set-up-locale-external-format ()
"Add external format alias for :locale to the format specified by
the locale as set by setlocale(3C)."
- (let ((codeset (unix::unix-get-locale-codeset)))
+ (let ((codeset (unix::unix-get-locale-codeset))
+ (external-format nil))
(cond ((zerop (length codeset))
- ;; Codeset was the empty string, so just set :locale to
- ;; alias to the default external format.
+ (setq external-format *default-external-format*))
+ (t
+ (let ((name (intern codeset "KEYWORD")))
+ (setq external-format
+ (stream::ef-name (stream::find-external-format name nil))))))
+ (cond (external-format
(setf (gethash :locale stream::*external-format-aliases*)
- *default-external-format*))
+ external-format))
(t
- ;; 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 final-format
- (stream::ef-name final-format)
- (progn
- (warn "Unsupported external format; using :iso8859-1 instead: ~S"
- codeset-format)
- :iso8859-1)))))))
+ (warn "No external format found for codeset \"~S\"; using ~S instead"
+ codeset
+ *default-external-format*)
+ (setf (gethash :locale stream::*external-format-aliases*)
+ *default-external-format*))))
(values))
@@ -285,8 +282,9 @@
(intl::setlocale)
;; Set up :locale format
(set-up-locale-external-format)
- ;; Set terminal encodings to :locale
- (set-system-external-format :locale)
+ ;; Set terminal encodings to :locale and filename encoding to :utf-8.
+ ;; (This needs more work on Darwin.)
+ (set-system-external-format :locale :utf-8)
(ext::process-command-strings process-command-line)
(setf *editor-lisp-p* nil)
(macrolet ((find-switch (name)
=====================================
tests/issues.lisp
=====================================
@@ -682,10 +682,7 @@
;; work and not return NIL.
(assert-true (file-author "."))
(assert-true (file-author "bin/build.sh"))
- (let ((unix::*filename-encoding* :utf-8))
- ;; Set filename encoding to utf-8 so that we can encode the
- ;; filename properly.
- (assert-true
+ (assert-true
(file-author
(merge-pathnames
(concatenate 'string
@@ -696,7 +693,7 @@
'(#\Hangul_Syllable_An #\Hangul_Syllable_Nyeong #\Hangul_Syllable_Ha
#\Hangul_Syllable_Sib #\Hangul_Syllable_Ni #\Hangul_Syllable_Gga)
".txt")
- *test-path*)))))
+ *test-path*))))
(define-test issue.139-default-external-format
(:tag :issues)
@@ -709,9 +706,14 @@
(assert-eq locale-format (stream-external-format sys:*stdout*))
(assert-eq locale-format (stream-external-format sys:*stderr*))
;; sys:*tty* can either be an fd-stream or a two-way-stream.
- ;; stream-external-format doesn't work for a two-way-stream.
- (unless (typep sys:*tty* 'two-way-stream)
- (assert-eq locale-format (stream-external-format sys:*tty*)))))
+ (etypecase sys:*tty*
+ (system:fd-stream
+ (assert-eq locale-format (stream-external-format sys:*tty*)))
+ (two-way-stream
+ (assert-eq locale-format
+ (stream-external-format (two-way-stream-input-stream sys:*tty*)))
+ (assert-eq locale-format
+ (stream-external-format (two-way-stream-output-stream sys:*tty*)))))))
(define-test issue.139-default-external-format-read-file
(:tag :issues)
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/11e9eadcc18a3e0edd412c…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/11e9eadcc18a3e0edd412c…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
1af83384 by Raymond Toy at 2022-12-08T14:57:43+00:00
Address #139: Set terminal format to :locale
- - - - -
6fc2e38e by Raymond Toy at 2022-12-08T14:57:45+00:00
Merge branch 'issue-139-set-terminal-to-utf8' into 'master'
Address #139: Set terminal format to :locale
See merge request cmucl/cmucl!108
- - - - -
3 changed files:
- src/code/fd-stream.lisp
- src/code/save.lisp
- tests/issues.lisp
Changes:
=====================================
src/code/fd-stream.lisp
=====================================
@@ -2397,10 +2397,10 @@
(setf *available-buffers* nil)
(setf *stdin*
(make-fd-stream 0 :name "Standard Input" :input t :buffering :line
- :external-format :iso8859-1))
+ :external-format :utf-8))
(setf *stdout*
(make-fd-stream 1 :name "Standard Output" :output t :buffering :line
- :external-format :iso8859-1))
+ :external-format :utf-8))
(setf *stderr*
(make-fd-stream 2 :name "Standard Error" :output t :buffering :line
:external-format :iso8859-1))
@@ -2410,7 +2410,7 @@
(if tty
(make-fd-stream tty :name "the Terminal" :input t :output t
:buffering :line :auto-close t
- :external-format :iso8859-1)
+ :external-format :utf-8)
(make-two-way-stream *stdin* *stdout*))))
nil)
=====================================
src/code/save.lisp
=====================================
@@ -145,24 +145,23 @@
(defun set-up-locale-external-format ()
"Add external format alias for :locale to the format specified by
the locale as set by setlocale(3C)."
- (let ((codeset (unix::unix-get-locale-codeset)))
+ (let ((codeset (unix::unix-get-locale-codeset))
+ (external-format nil))
(cond ((zerop (length codeset))
- ;; Codeset was the empty string, so just set :locale to
- ;; alias to the default external format.
+ (setq external-format *default-external-format*))
+ (t
+ (let ((name (intern codeset "KEYWORD")))
+ (setq external-format
+ (stream::ef-name (stream::find-external-format name nil))))))
+ (cond (external-format
(setf (gethash :locale stream::*external-format-aliases*)
- *default-external-format*))
+ 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
- ;; alias.
- (setf (gethash :locale stream::*external-format-aliases*)
- (if (stream::find-external-format codeset-format nil)
- codeset-format
- (progn
- (warn "Unsupported external format; using :iso8859-1 instead: ~S"
- codeset-format)
- :iso8859-1)))))))
+ (warn "No external format found for codeset \"~S\"; using ~S instead"
+ codeset
+ *default-external-format*)
+ (setf (gethash :locale stream::*external-format-aliases*)
+ *default-external-format*))))
(values))
@@ -283,6 +282,8 @@
(intl::setlocale)
;; Set up :locale format
(set-up-locale-external-format)
+ ;; Set terminal encodings to :locale
+ (set-system-external-format :locale)
(ext::process-command-strings process-command-line)
(setf *editor-lisp-p* nil)
(macrolet ((find-switch (name)
=====================================
tests/issues.lisp
=====================================
@@ -700,7 +700,23 @@
(define-test issue.139-default-external-format
(:tag :issues)
- (assert-eq :utf-8 stream:*default-external-format*))
+ (assert-eq :utf-8 stream:*default-external-format*)
+ ;; Find the alias for :locale, and verify it exists and verify that
+ ;; the system streams have that format.
+ (let ((locale-format (gethash :locale stream::*external-format-aliases*)))
+ (assert locale-format)
+ (assert-eq locale-format (stream-external-format sys:*stdin*))
+ (assert-eq locale-format (stream-external-format sys:*stdout*))
+ (assert-eq locale-format (stream-external-format sys:*stderr*))
+ ;; sys:*tty* can either be an fd-stream or a two-way-stream.
+ (etypecase sys:*tty*
+ (system:fd-stream
+ (assert-eq locale-format (stream-external-format sys:*tty*)))
+ (two-way-stream
+ (assert-eq locale-format
+ (stream-external-format (two-way-stream-input-stream sys:*tty*)))
+ (assert-eq locale-format
+ (stream-external-format (two-way-stream-output-stream sys:*tty*)))))))
(define-test issue.139-default-external-format-read-file
(:tag :issues)
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/bea349948b06626fd33026…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/bea349948b06626fd33026…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-139-set-terminal-to-utf8 at cmucl / cmucl
Commits:
a34aa173 by Raymond Toy at 2022-12-04T08:28:25-08:00
Test external format if sys:*tty* is a two-way-stream
`sys:*tty*` can be an `fd-stream` or `two-way-stream`. Test that the
external format in both cases has the expected value.
- - - - -
1 changed file:
- tests/issues.lisp
Changes:
=====================================
tests/issues.lisp
=====================================
@@ -709,9 +709,14 @@
(assert-eq locale-format (stream-external-format sys:*stdout*))
(assert-eq locale-format (stream-external-format sys:*stderr*))
;; sys:*tty* can either be an fd-stream or a two-way-stream.
- ;; stream-external-format doesn't work for a two-way-stream.
- (unless (typep sys:*tty* 'two-way-stream)
- (assert-eq locale-format (stream-external-format sys:*tty*)))))
+ (etypecase sys:*tty*
+ (system:fd-stream
+ (assert-eq locale-format (stream-external-format sys:*tty*)))
+ (two-way-stream
+ (assert-eq locale-format
+ (stream-external-format (two-way-stream-input-stream sys:*tty*)))
+ (assert-eq locale-format
+ (stream-external-format (two-way-stream-output-stream sys:*tty*)))))))
(define-test issue.139-default-external-format-read-file
(:tag :issues)
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/a34aa173120c6efd4769670…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/a34aa173120c6efd4769670…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-139-set-terminal-to-utf8 at cmucl / cmucl
Commits:
5036c2a4 by Raymond Toy at 2022-12-04T07:59:54-08:00
After finding the external format, get the format name
Fix minor issue in previous commit; `stream::find-external-format`
returns an `stream::external-format` object, but we want the name of
the format instead when we set the alias.
- - - - -
1 changed file:
- src/code/save.lisp
Changes:
=====================================
src/code/save.lisp
=====================================
@@ -151,7 +151,8 @@
(setq external-format *default-external-format*))
(t
(let ((name (intern codeset "KEYWORD")))
- (setq external-format (stream::find-external-format name nil)))))
+ (setq external-format
+ (stream::ef-name (stream::find-external-format name nil))))))
(cond (external-format
(setf (gethash :locale stream::*external-format-aliases*)
external-format))
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/5036c2a40b3c613df367cc5…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/5036c2a40b3c613df367cc5…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-139-set-terminal-to-utf8 at cmucl / cmucl
Commits:
9c4f0be9 by Raymond Toy at 2022-12-04T07:29:24-08:00
Remove LANG setting
- - - - -
1 changed file:
- bin/run-tests.sh
Changes:
=====================================
bin/run-tests.sh
=====================================
@@ -47,10 +47,6 @@ function cleanup {
trap cleanup EXIT
-# Set a known value for LANG here so that we can tests consistently.
-# The most important part is that the codeset is UTF-8.
-LANG=en_US.UTF-8
-
if [ $# -eq 0 ]; then
# No args so run all the tests
$LISP -noinit -load tests/run-tests.lisp -eval '(cmucl-test-runner:run-all-tests)'
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/9c4f0be9ded0a16ec1ed34c…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/9c4f0be9ded0a16ec1ed34c…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-139-set-terminal-to-utf8 at cmucl / cmucl
Commits:
cd9ba2f1 by Carl S. Shapiro at 2022-12-04T15:27:49+00:00
Apply 1 suggestion(s) to 1 file(s)
- - - - -
1 changed file:
- src/code/save.lisp
Changes:
=====================================
src/code/save.lisp
=====================================
@@ -145,26 +145,22 @@
(defun set-up-locale-external-format ()
"Add external format alias for :locale to the format specified by
the locale as set by setlocale(3C)."
- (let ((codeset (unix::unix-get-locale-codeset)))
+ (let ((codeset (unix::unix-get-locale-codeset))
+ (external-format nil))
(cond ((zerop (length codeset))
- ;; Codeset was the empty string, so just set :locale to
- ;; alias to the default external format.
+ (setq external-format *default-external-format*))
+ (t
+ (let ((name (intern codeset "KEYWORD")))
+ (setq external-format (stream::find-external-format name nil)))))
+ (cond (external-format
(setf (gethash :locale stream::*external-format-aliases*)
- *default-external-format*))
+ external-format))
(t
- ;; 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 final-format
- (stream::ef-name final-format)
- (progn
- (warn "Unsupported external format; using :iso8859-1 instead: ~S"
- codeset-format)
- :iso8859-1)))))))
+ (warn "No external format found for codeset \"~S\"; using ~S instead"
+ codeset
+ *default-external-format*)
+ (setf (gethash :locale stream::*external-format-aliases*)
+ *default-external-format*))))
(values))
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/cd9ba2f1d7f610baefabf8b…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/cd9ba2f1d7f610baefabf8b…
You're receiving this email because of your account on gitlab.common-lisp.net.