Raymond Toy pushed to branch issue-139-add-alias-local-external-format at cmucl / cmucl

Commits:

7 changed files:

Changes:

  • src/code/save.lisp
    ... ... @@ -273,7 +273,11 @@
    273 273
     	     (reinit)
    
    274 274
     	     (environment-init)
    
    275 275
     	     (dolist (f *after-save-initializations*) (funcall f))
    
    276
    +	     ;; Set the runtime locale
    
    277
    +	     (unless (zerop (unix::unix-setlocale))
    
    278
    +	       (warn "os_setlocale failed"))
    
    276 279
     	     (stream::load-external-format-aliases)
    
    280
    +	     ;; Set the locale for lisp
    
    277 281
     	     (intl::setlocale)
    
    278 282
     	     (ext::process-command-strings process-command-line)
    
    279 283
     	     (setf *editor-lisp-p* nil)
    

  • src/code/unix.lisp
    ... ... @@ -2894,6 +2894,12 @@
    2894 2894
        doesn't work."
    
    2895 2895
       (int-syscall ("fork")))
    
    2896 2896
     
    
    2897
    +(defun unix-setlocale ()
    
    2898
    +  _N"Call setlocale(3c) with fixed args.  Returns 0 on success."
    
    2899
    +  (alien:alien-funcall
    
    2900
    +   (alien:extern-alien "os_setlocale"
    
    2901
    +		       (function c-call:int))))
    
    2902
    +
    
    2897 2903
     (defun unix-get-locale-codeset ()
    
    2898 2904
       _N"Get the codeset from the locale"
    
    2899 2905
       (with-alien ((codeset (array c-call:char 512)))
    

  • src/general-info/release-21e.md
    ... ... @@ -51,14 +51,18 @@ public domain.
    51 51
         * ~~#113~~ REQUIRE on contribs can pull in the wrong things via ASDF.
    
    52 52
         * ~~#121~~ Wrong column index in FILL-POINTER-OUTPUT-STREAM
    
    53 53
         * ~~#122~~ gcc 11 can't build cmucl
    
    54
    +    * ~~#124~~ directory with `:wild-inferiors` doesn't descend subdirectories 
    
    54 55
         * ~~#125~~ Linux `unix-stat` returning incorrect values
    
    55 56
         * ~~#127~~ Linux unix-getpwuid segfaults when given non-existent uid.
    
    56 57
         * ~~#128~~ `QUIT` accepts an exit code
    
    58
    +    * ~~#130~~ Move file-author to C 
    
    57 59
         * ~~#132~~ Ansi test `RENAME-FILE.1` no fails
    
    58 60
         * ~~#134~~ Handle the case of `(expt complex complex-rational)`
    
    59 61
         * ~~#136~~ `ensure-directories-exist` should return the given pathspec
    
    60 62
         * #139 `*default-external-format*` defaults to `:utf-8`
    
    61 63
         * ~~#142~~ `(random 0)` signals incorrect error
    
    64
    +    * ~~#147~~ `stream-line-column` method missing for `fundamental-character-output-stream`
    
    65
    +    * ~~#149~~ Call setlocale(3C) on startup
    
    62 66
       * Other changes:
    
    63 67
       * Improvements to the PCL implementation of CLOS:
    
    64 68
       * Changes to building procedure:
    

  • src/i18n/locale/cmucl-unix.pot
    ... ... @@ -1424,3 +1424,7 @@ msgid ""
    1424 1424
     "   doesn't work."
    
    1425 1425
     msgstr ""
    
    1426 1426
     
    
    1427
    +#: src/code/unix.lisp
    
    1428
    +msgid "Call setlocale(3c) with fixed args.  Returns 0 on success."
    
    1429
    +msgstr ""
    
    1430
    +

  • src/lisp/os-common.c
    ... ... @@ -776,6 +776,15 @@ exit:
    776 776
         return result;
    
    777 777
     }
    
    778 778
     
    
    779
    +int
    
    780
    +os_setlocale(void)
    
    781
    +{
    
    782
    +    char *result = setlocale(LC_ALL, "");
    
    783
    +
    
    784
    +    /* Return 0 if setlocale suceeded; otherwise -1. */
    
    785
    +    return result != NULL ? 0 : -1;
    
    786
    +}
    
    787
    +
    
    779 788
     void
    
    780 789
     os_get_locale_codeset(char* codeset, int len)
    
    781 790
     {
    
    ... ... @@ -787,3 +796,4 @@ os_get_locale_codeset(char* codeset, int len)
    787 796
     
    
    788 797
         strncpy(codeset, code, len);
    
    789 798
     }
    
    799
    +

  • src/pcl/simple-streams/external-formats/aliases
    ... ... @@ -223,6 +223,8 @@ windows-cp1252 cp1252
    223 223
     windows-latin1	cp1252
    
    224 224
     ms-ansi		cp1252
    
    225 225
     
    
    226
    +euckr		euc-kr
    
    227
    +cp949		euc-kr
    
    226 228
     ;; These are not yet implemented
    
    227 229
     ;;iso-2022-jp	iso2022-jp
    
    228 230
     ;;iso2022jp	iso2022-jp
    

  • tests/issues.lisp
    ... ... @@ -745,3 +745,10 @@
    745 745
           (assert-equal (map 'list #'char-name string)
    
    746 746
     		    (map 'list #'char-name (read-line s))))))
    
    747 747
       
    
    748
    +
    
    749
    +(define-test issue.150
    
    750
    +    (:tag :issues)
    
    751
    +  (let ((ext:*gc-verbose* nil)
    
    752
    +	(*compile-print* nil))
    
    753
    +    (assert-true (stream::find-external-format :euckr))
    
    754
    +    (assert-true (stream::find-external-format :cp949))))