Convert UNICODE to LF
Don't know why it reverted. Just a MAKEFILE NEW and recompile
This commit is contained in:
417
library/UNICODE
417
library/UNICODE
@@ -1,18 +1,16 @@
|
||||
(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)
|
||||
(FILECREATED "21-Aug-2021 13:13:04"
|
||||
{DSK}<Users>kaplan>Local>medley3.5>git-medley>library>UNICODE.;193 64903
|
||||
(FILECREATED "30-Sep-2021 16:03:18"
|
||||
{DSK}<Users>kaplan>Local>medley3.5>git-medley>library>UNICODE.;194 64783
|
||||
|
||||
changes to%: (FNS MAKE-UNICODE-TRANSLATION-TABLES)
|
||||
|
||||
previous date%: " 8-Aug-2021 13:10:17"
|
||||
{DSK}<Users>kaplan>Local>medley3.5>git-medley>library>UNICODE.;192)
|
||||
previous date%: "21-Aug-2021 13:13:04"
|
||||
{DSK}<Users>kaplan>Local>medley3.5>git-medley>library>UNICODE.;193)
|
||||
|
||||
|
||||
(PRETTYCOMPRINT UNICODECOMS)
|
||||
|
||||
(RPAQQ UNICODECOMS
|
||||
[(COMS
|
||||
(* ;; "External formats")
|
||||
(* ;; "External formats")
|
||||
|
||||
(FNS UTF8.OUTCHARFN UTF8.INCCODEFN UTF8.PEEKCCODEFN \UTF8.BACKCCODEFN)
|
||||
(FNS UTF16BE.OUTCHARFN UTF16BE.INCCODEFN UTF16BE.PEEKCCODEFN \UTF16.BACKCCODEFN)
|
||||
@@ -25,14 +23,14 @@
|
||||
(DECLARE%: EVAL@COMPILE DONTCOPY (MACROS UNICODE.TRANSLATE))
|
||||
(FNS XTOUCODE UTOXCODE))
|
||||
[COMS
|
||||
(* ;; "Unicode mapping files")
|
||||
(* ;; "Unicode mapping files")
|
||||
|
||||
(FNS READ-UNICODE-MAPPING-FILENAMES READ-UNICODE-MAPPING WRITE-UNICODE-MAPPING
|
||||
WRITE-UNICODE-INCLUDED WRITE-UNICODE-MAPPING-HEADER WRITE-UNICODE-MAPPING-FILENAME
|
||||
)
|
||||
(VARS XCCS-SET-NAMES)
|
||||
|
||||
(* ;; "Automate dumping of a documentation prefix")
|
||||
(* ;; "Automate dumping of a documentation prefix")
|
||||
|
||||
[DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (MISSINGCODE (CL:PARSE-INTEGER "FFFE"
|
||||
:RADIX 16))
|
||||
@@ -43,7 +41,7 @@
|
||||
(P (PUSHNEW UNICODEDIRECTORIES (PACK* (UNIX-GETENV "MEDLEYDIR")
|
||||
'/unicode/xerox/]
|
||||
(COMS
|
||||
(* ;; "Set up translation tables for UTF8 and UTFBE external formats")
|
||||
(* ;; "Set up translation tables for UTF8 and UTFBE external formats")
|
||||
|
||||
(FNS MAKE-UNICODE-TRANSLATION-TABLES)
|
||||
[INITVARS (DEFAULT-XCCS-CHARSETS '(LATIN SYMBOLS1 SYMBOLS2 EXTENDED-LATIN FORMS
|
||||
@@ -63,7 +61,7 @@
|
||||
"NOTE: UNICODE requires EXPORTS.ALL for compilation"
|
||||
T)))
|
||||
|
||||
(* ;; "These control the layout of the translation tables. Since many of the upper panels are sparse, doing it per-panel (128) seems more space-efficient, and residual alists can be shorter")
|
||||
(* ;; "These control the layout of the translation tables. Since many of the upper panels are sparse, doing it per-panel (128) seems more space-efficient, and residual alists can be shorter")
|
||||
|
||||
(CONSTANTS (TRANSLATION-SEGMENT-SIZE 128)
|
||||
(MAX-ALIST-LENGTH 10)
|
||||
@@ -78,13 +76,13 @@
|
||||
(DEFINEQ
|
||||
|
||||
(UTF8.OUTCHARFN
|
||||
[LAMBDA (STREAM CHARCODE RAW) (* ; "Edited 8-Aug-2021 13:02 by rmk:")
|
||||
(* ; "Edited 17-Aug-2020 08:45 by rmk:")
|
||||
(* ; "Edited 30-Jan-2020 23:08 by rmk:")
|
||||
[LAMBDA (STREAM CHARCODE RAW) (* ; "Edited 8-Aug-2021 13:02 by rmk:")
|
||||
(* ; "Edited 17-Aug-2020 08:45 by rmk:")
|
||||
(* ; "Edited 30-Jan-2020 23:08 by rmk:")
|
||||
|
||||
(* ;; "Perhaps the translation table should already do the mapping for EOL to LF, but that seems to be a separate property of the stream. Also, CRLF=2 bytes.")
|
||||
(* ;; "Perhaps the translation table should already do the mapping for EOL to LF, but that seems to be a separate property of the stream. Also, CRLF=2 bytes.")
|
||||
|
||||
(* ;; "Print UTF8 sequence for CHARCODE. Do not do XCCS to Unicode translation if RAW.")
|
||||
(* ;; "Print UTF8 sequence for CHARCODE. Do not do XCCS to Unicode translation if RAW.")
|
||||
|
||||
(IF (EQ CHARCODE (CHARCODE EOL))
|
||||
THEN (FREPLACE (STREAM CHARPOSITION) OF STREAM WITH 0)
|
||||
@@ -97,13 +95,13 @@
|
||||
DO (IF (ILESSP C 128)
|
||||
THEN (\BOUT STREAM C)
|
||||
ELSEIF (ILESSP C 2048)
|
||||
THEN (* ; "x800")
|
||||
THEN (* ; "x800")
|
||||
(\BOUT STREAM (LOGOR (LLSH 3 6)
|
||||
(LRSH C 6)))
|
||||
(\BOUT STREAM (LOGOR (LLSH 2 6)
|
||||
(LOADBYTE C 0 6)))
|
||||
ELSEIF (ILESSP C 65536)
|
||||
THEN (* ; "x10000")
|
||||
THEN (* ; "x10000")
|
||||
(\BOUT STREAM (LOGOR (LLSH 7 5)
|
||||
(LRSH C 12)))
|
||||
(\BOUT STREAM (LOGOR (LLSH 2 6)
|
||||
@@ -111,7 +109,7 @@
|
||||
(\BOUT STREAM (LOGOR (LLSH 2 6)
|
||||
(LOADBYTE C 0 6)))
|
||||
ELSEIF (ILESSP C 2097152)
|
||||
THEN (* ; "x200000")
|
||||
THEN (* ; "x200000")
|
||||
(\BOUT STREAM (LOGOR (LLSH 15 4)
|
||||
(LRSH C 18)))
|
||||
(\BOUT STREAM (LOGOR (LLSH 2 6)
|
||||
@@ -123,29 +121,29 @@
|
||||
ELSE (ERROR "CHARCODE too big for UTF8" C])
|
||||
|
||||
(UTF8.INCCODEFN
|
||||
[LAMBDA (STREAM COUNTP RAW) (* ; "Edited 6-Aug-2021 16:02 by rmk:")
|
||||
(* ; "Edited 6-Aug-2020 17:13 by rmk:")
|
||||
[LAMBDA (STREAM COUNTP RAW) (* ; "Edited 6-Aug-2021 16:02 by rmk:")
|
||||
(* ; "Edited 6-Aug-2020 17:13 by rmk:")
|
||||
|
||||
(* ;; "Do not do UNICODE to XCSS translation if RAW.")
|
||||
(* ;; "Do not do UNICODE to XCSS translation if RAW.")
|
||||
|
||||
(* ;; "Test for smallp because the stream's End-of-file operation may suppress the error")
|
||||
(* ;; "Test for smallp because the stream's End-of-file operation may suppress the error")
|
||||
|
||||
(DECLARE (USEDFREE *BYTECOUNTER*))
|
||||
(LET (BYTE1 BYTE2 BYTE3 BYTE4 CODE (COUNT 1))
|
||||
(SETQ BYTE1 (\BIN STREAM))
|
||||
|
||||
(* ;; "Distinguish on header bytes (modulo peculiar EOF behavior--the caller will get whatever ended up in BYTE1")
|
||||
(* ;; "Distinguish on header bytes (modulo peculiar EOF behavior--the caller will get whatever ended up in BYTE1")
|
||||
|
||||
(CL:WHEN (SMALLP BYTE1)
|
||||
[SETQ CODE (IF (ILESSP BYTE1 128)
|
||||
THEN
|
||||
|
||||
(* ;;
|
||||
"Test first: Ascii is the common case. EOL requires its own translation")
|
||||
(* ;;
|
||||
"Test first: Ascii is the common case. EOL requires its own translation")
|
||||
|
||||
(SELCHARQ BYTE1
|
||||
(CR (SELECTC (FETCH (STREAM EOLCONVENTION) OF STREAM)
|
||||
(CR.EOLC (* ; "Also eq BYTE1")
|
||||
(CR.EOLC (* ; "Also eq BYTE1")
|
||||
(CHARCODE EOL))
|
||||
(CRLF.EOLC (IF (EQ (CHARCODE LF)
|
||||
(\PEEKBIN STREAM T))
|
||||
@@ -160,7 +158,7 @@
|
||||
BYTE1))
|
||||
BYTE1)
|
||||
ELSEIF (IGEQ BYTE1 (LLSH 15 4))
|
||||
THEN (* ; "4 bytes")
|
||||
THEN (* ; "4 bytes")
|
||||
(SETQ BYTE2 (\BIN STREAM))
|
||||
(CL:WHEN (OR (NOT (SMALLP BYTE2))
|
||||
(ILESSP BYTE2 128))
|
||||
@@ -182,7 +180,7 @@
|
||||
6)
|
||||
(LOADBYTE BYTE4 0 6))
|
||||
ELSEIF (IGEQ BYTE1 (LLSH 7 5))
|
||||
THEN (* ; "3 bytes")
|
||||
THEN (* ; "3 bytes")
|
||||
(SETQ BYTE2 (\BIN STREAM))
|
||||
(CL:WHEN (OR (NOT (SMALLP BYTE2))
|
||||
(ILESSP BYTE2 128))
|
||||
@@ -197,7 +195,7 @@
|
||||
(LLSH (LOADBYTE BYTE2 0 6)
|
||||
6)
|
||||
(LOADBYTE BYTE3 0 6))
|
||||
ELSE (* ; "Must be 2 bytes")
|
||||
ELSE (* ; "Must be 2 bytes")
|
||||
(SETQ COUNT 2)
|
||||
(SETQ BYTE2 (\BIN STREAM))
|
||||
(CL:WHEN (OR (NOT (SMALLP BYTE2))
|
||||
@@ -211,12 +209,97 @@
|
||||
(CL:WHEN COUNTP (SETQ *BYTECOUNTER* COUNT))
|
||||
CODE])
|
||||
|
||||
(UTF8.PEEKCCODEFN
|
||||
(UTF8.PEEKCCODEFN
|
||||
[LAMBDA (STREAM NOERROR RAW) (* ; "Edited 14-Jun-2021 22:53 by rmk:")
|
||||
|
||||
(* ;; "Modeled this after \EUCPEEK on LLREAD. In the multi-byte (non-ASCII) case, backs the file pointer to the beginning by the proper number of \BACKFILEPTRs, and returns a count of 0. Returns NIL if NOERROR and either invalid UTF8 or end of file.")
|
||||
|
||||
(* ;; "Could be that the caller takes care of backing up the file position if the number of binned-bytes is returned.")
|
||||
|
||||
(* ;; "Do not do UNICODE to XCCS translation if RAW")
|
||||
|
||||
(PROG (BYTE1 BYTE2 BYTE3 BYTE4 CODE)
|
||||
(SETQ BYTE1 (\PEEKBIN STREAM NOERROR))
|
||||
|
||||
(* ;; "Distinguish on header bytex")
|
||||
|
||||
(CL:UNLESS BYTE1 (RETURN NIL))
|
||||
[IF (ILESSP BYTE1 128)
|
||||
THEN
|
||||
|
||||
(* ;;
|
||||
"Test first: Ascii is the common case. No need to back up, since we peeked.")
|
||||
|
||||
(SETQ CODE BYTE1)
|
||||
ELSEIF (IGEQ BYTE1 (LLSH 15 4))
|
||||
THEN (* ; "4 bytes")
|
||||
(\BIN STREAM)
|
||||
(CL:UNLESS (AND (SETQ BYTE2 (\PEEKBIN STREAM NOERROR))
|
||||
(IGEQ BYTE2 128))
|
||||
(\BACKFILEPTR STREAM)
|
||||
(OR NOERROR (ERROR "INVALID UTF8 SEQUENCE" (LIST BYTE1 BYTE2)))
|
||||
(RETURN CODE))
|
||||
(\BIN STREAM)
|
||||
(CL:UNLESS (AND (SETQ BYTE3 (\PEEKBIN STREAM NOERROR))
|
||||
(IGEQ BYTE3 128))
|
||||
(\BACKFILEPTR STREAM)
|
||||
(\BACKFILEPTR STREAM)
|
||||
(OR NOERROR (ERROR "INVALID UTF8 SEQUENCE" (LIST BYTE1 BYTE2 BYTE3)))
|
||||
(RETURN CODE))
|
||||
(\BIN STREAM)
|
||||
(SETQ BYTE4 (\PEEKBIN STREAM NOERROR)) (* ;
|
||||
"PEEK the last, no need to back it up")
|
||||
(\BACKFILEPTR STREAM)
|
||||
(\BACKFILEPTR STREAM)
|
||||
(\BACKFILEPTR STREAM)
|
||||
(IF (AND BYTE4 (IGEQ BYTE4 128))
|
||||
THEN (SETQ CODE (LOGOR (LLSH (LOADBYTE BYTE1 0 3)
|
||||
18)
|
||||
(LLSH (LOADBYTE BYTE2 0 6)
|
||||
12)
|
||||
(LLSH (LOADBYTE BYTE3 0 6)
|
||||
6)
|
||||
(LOADBYTE BYTE4 0 6)))
|
||||
ELSEIF NOERROR
|
||||
ELSE (ERROR "INVALID UTF8 SEQUENCE" (LIST BYTE1 BYTE2 BYTE3 BYTE4)))
|
||||
ELSEIF (IGEQ BYTE1 (LLSH 7 5))
|
||||
THEN (* ; "3 bytes")
|
||||
(\BIN STREAM)
|
||||
(CL:UNLESS (AND (SETQ BYTE2 (\PEEKBIN STREAM NOERROR))
|
||||
(IGEQ BYTE2 128))
|
||||
(\BACKFILEPTR STREAM)
|
||||
(OR NOERROR (ERROR "INVALID UTF8 SEQUENCE" (LIST BYTE1 BYTE2)))
|
||||
(RETURN CODE))
|
||||
(\BIN STREAM)
|
||||
(SETQ BYTE3 (\PEEKBIN STREAM NOERROR))
|
||||
(\BACKFILEPTR STREAM)
|
||||
(\BACKFILEPTR STREAM)
|
||||
(IF (AND BYTE3 (IGEQ BYTE3 128))
|
||||
THEN (SETQ CODE (LOGOR (LLSH (LOADBYTE BYTE1 0 4)
|
||||
12)
|
||||
(LLSH (LOADBYTE BYTE2 0 6)
|
||||
6)
|
||||
(LOADBYTE BYTE3 0 6)))
|
||||
ELSEIF NOERROR
|
||||
ELSE (ERROR "INVALID UTF8 SEQUENCE" (LIST BYTE1 BYTE2 BYTE3)))
|
||||
ELSE (* ; "Must be 2 bytes")
|
||||
(\BIN STREAM)
|
||||
(SETQ BYTE2 (\PEEKBIN STREAM NOERROR))
|
||||
(\BACKFILEPTR STREAM)
|
||||
(IF (AND BYTE2 (IGEQ BYTE2 128))
|
||||
THEN (SETQ CODE (LOGOR (LLSH (LOADBYTE BYTE1 0 5)
|
||||
6)
|
||||
(LOADBYTE BYTE2 0 6)))
|
||||
ELSEIF NOERROR
|
||||
ELSE (ERROR "INVALID UTF8 SEQUENCE" (LIST BYTE1 BYTE2]
|
||||
(CL:WHEN (AND CODE (NOT RAW))
|
||||
(SETQ CODE (UNICODE.TRANSLATE CODE *UNICODETOXCCS*)))
|
||||
(RETURN CODE])
|
||||
|
||||
(\UTF8.BACKCCODEFN
|
||||
(* ;; "Modeled this after \EUCPEEK on LLREAD. In the multi-byte (non-ASCII) case, backs the file pointer to the beginning by the proper number of \BACKFILEPTRs, and returns a count of 0. Returns NIL if NOERROR and either invalid UTF8 or end of file.")
|
||||
[LAMBDA (STREAM COUNTP) (* ; "Edited 6-Aug-2021 16:04 by rmk:")
|
||||
|
||||
(* ;; "Could be that the caller takes care of backing up the file position if the number of binned-bytes is returned.")
|
||||
(* ;; "\BACKFILEPTR is NIL at beginning of FILE, just return COUNT")
|
||||
|
||||
(DECLARE (USEDFREE *BYTECOUNTER*))
|
||||
(BIND (C _ 0) WHILE (CL:WHEN (\BACKFILEPTR STREAM)
|
||||
@@ -228,12 +311,12 @@
|
||||
(DEFINEQ
|
||||
|
||||
(UTF16BE.OUTCHARFN
|
||||
|
||||
(* ;;
|
||||
[LAMBDA (STREAM CHARCODE RAW) (* ; "Edited 8-Aug-2021 13:09 by rmk:")
|
||||
(* ; "Edited 30-Jan-2020 23:08 by rmk:")
|
||||
|
||||
|
||||
(* ;; "PRINT UTF16 sequence for CHARCODE. Do not do XCCS to UNICODE translation if RAW.")
|
||||
|
||||
ELSEIF (IGEQ BYTE1 (LLSH 15 4))
|
||||
(* ;; "Not sure about EOL conversion if truly %"raw%"")
|
||||
|
||||
(IF (EQ CHARCODE (CHARCODE EOL))
|
||||
THEN (FREPLACE (STREAM CHARPOSITION) OF STREAM WITH 0)
|
||||
@@ -245,10 +328,10 @@
|
||||
DO (\WOUT STREAM C])
|
||||
|
||||
(UTF16BE.INCCODEFN
|
||||
(\BACKFILEPTR STREAM)
|
||||
[LAMBDA (STREAM COUNTP RAW) (* ; "Edited 6-Aug-2021 16:05 by rmk:")
|
||||
|
||||
(RETURN CODE))
|
||||
(\BIN STREAM)
|
||||
(* ;;
|
||||
"Do not do UNICODE to XCCS translation if RAW. Test for SMALLPin case of funky EOF behavior")
|
||||
|
||||
(DECLARE (USEDFREE *BYTECOUNTER*))
|
||||
(LET (CODE BYTE1 BYTE2 COUNT)
|
||||
@@ -264,14 +347,37 @@
|
||||
CODE
|
||||
ELSE (ERROR "ODD NUMBER OF BYTES IN UTF16 FILE" STREAM])
|
||||
|
||||
ELSEIF (IGEQ BYTE1 (LLSH 7 5))
|
||||
(UTF16BE.PEEKCCODEFN
|
||||
[LAMBDA (STREAM NOERROR RAW) (* ; "Edited 14-Jun-2021 22:58 by rmk:")
|
||||
|
||||
(* ;; "Could be that the caller takes care of backing up the file position if the number of binned-bytes is returned.")
|
||||
|
||||
(* ;; "Do not do UNICODE to XCCS translation if RAW")
|
||||
|
||||
(LET (BYTE1 BYTE2 CODE)
|
||||
(SETQ BYTE1 (\PEEKBIN STREAM NOERROR))
|
||||
(IF BYTE1
|
||||
THEN (\BIN STREAM)
|
||||
(SETQ BYTE2 (\PEEKBIN STREAM NOERROR))
|
||||
(\BACKFILEPTR STREAM)
|
||||
(IF BYTE2
|
||||
THEN (SETQ CODE (LOGOR (LLSH BYTE1 8)
|
||||
BYTE2))
|
||||
(CL:IF RAW
|
||||
CODE
|
||||
(UNICODE.TRANSLATE CODE *UNICODETOXCCS*))
|
||||
ELSEIF NOERROR
|
||||
THEN NIL)
|
||||
ELSEIF NOERROR
|
||||
THEN NIL
|
||||
ELSE (ERROR "INVALID UTF16 CHARACTER" (LIST BYTE1 BYTE2])
|
||||
|
||||
(\UTF16.BACKCCODEFN
|
||||
(CL:UNLESS (AND (SETQ BYTE2 (\PEEKBIN STREAM NOERROR))
|
||||
[LAMBDA (STREAM COUNTP) (* ; "Edited 6-Aug-2021 16:07 by rmk:")
|
||||
|
||||
(\BACKFILEPTR STREAM)
|
||||
(* ;; "\BACKFILEPTR is NIL at beginning of FILE, do nothing.")
|
||||
|
||||
(RETURN CODE))
|
||||
(* ;; "Common for big-ending and little-ending")
|
||||
|
||||
(DECLARE (USEDFREE *BYTECOUNTER*))
|
||||
(CL:WHEN (\BACKFILEPTR STREAM)
|
||||
@@ -285,11 +391,11 @@
|
||||
(DEFINEQ
|
||||
|
||||
(MAKE-UNICODE-FORMATS
|
||||
(\BIN STREAM)
|
||||
[LAMBDA (EXTERNALEOL) (* ; "Edited 6-Aug-2021 16:08 by rmk:")
|
||||
|
||||
(\BACKFILEPTR STREAM)
|
||||
(* ;; "RAW formats do not do XCCS/Unicode translation, just deal with the byte encoding.")
|
||||
|
||||
THEN (SETQ CODE (LOGOR (LLSH (LOADBYTE BYTE1 0 5)
|
||||
(* ;; "The EXTERNALEOL specifies the EOLCONVENTION of the stream, particularly to produce output files with the desired convention. On input the macro \CHECKEOLC (LLREAD) coerces only that coding to the internal EOL, which is a mistake.")
|
||||
|
||||
(MAKE-EXTERNALFORMAT :UTF-8 (FUNCTION UTF8.INCCODEFN)
|
||||
(FUNCTION UTF8.PEEKCCODEFN)
|
||||
@@ -325,11 +431,11 @@
|
||||
(DEFINEQ
|
||||
|
||||
(UNICODE.UNMAPPED
|
||||
CHARCODE
|
||||
[LAMBDA (CODE TRANSLATION-TABLE) (* ; "Edited 11-Aug-2020 20:23 by rmk:")
|
||||
|
||||
DO (\WOUT STREAM C])
|
||||
(* ;; "This is the slow fall-out when UNICODE.TRANSLATE determines that CODED has no fast mapping in TRANSLATION-TABLE.")
|
||||
|
||||
(UTF16BE.INCCODEFN
|
||||
(* ;; "We return an existing entry in the hash array of the table. If CODE has not previously been seen, we allocate a new code in the forward unmapped hasharray and put the inverse in the backward array.")
|
||||
|
||||
(LET ((FORWARD (CL:SVREF TRANSLATION-TABLE N-TRANSLATION-SEGMENTS))
|
||||
INVERSE NEXTCODE)
|
||||
@@ -349,9 +455,9 @@
|
||||
(DEFINEQ
|
||||
|
||||
(XCCS-UTF8-AFTER-OPEN
|
||||
(UTF16BE.PEEKCCODEFN
|
||||
[LAMBDA (STREAM ACCESS PARAMETERS) (* ; "Edited 13-Aug-2020 11:54 by rmk:")
|
||||
|
||||
|
||||
(* ;; "If added to STREAM-AFTER-OPEN-FNS, causes mapping files to be opened as UTF8.")
|
||||
|
||||
(CL:WHEN (AND (STRPOS "XCCS-" (U-CASE (FULLNAME STREAM)))
|
||||
[EQ 'TXT (U-CASE (FILENAMEFIELD (FULLNAME STREAM)
|
||||
@@ -379,11 +485,11 @@
|
||||
(DEFINEQ
|
||||
|
||||
(XTOUCODE
|
||||
(* ;; "Common for big-ending and little-ending")
|
||||
[LAMBDA (XCCSCODE) (* ; "Edited 9-Aug-2020 09:04 by rmk:")
|
||||
(UNICODE.TRANSLATE XCCSCODE *XCCSTOUNICODE*])
|
||||
|
||||
(UTOXCODE
|
||||
(IF (\BACKFILEPTR STREAM)
|
||||
[LAMBDA (UNICODE) (* ; "Edited 9-Aug-2020 09:04 by rmk:")
|
||||
(UNICODE.TRANSLATE UNICODE *UNICODETOXCCS*])
|
||||
)
|
||||
|
||||
@@ -394,9 +500,8 @@
|
||||
(DEFINEQ
|
||||
|
||||
(READ-UNICODE-MAPPING-FILENAMES
|
||||
|
||||
(* ;; "RAW formats do not do XCCS/Unicode translation, just deal with the byte encoding.")
|
||||
|
||||
[LAMBDA (FILESPEC) (* ; "Edited 5-Aug-2020 15:59 by kaplan")
|
||||
(* ; "Edited 4-Aug-2020 17:31 by rmk:")
|
||||
(FOR F X CSI INSIDE FILESPEC
|
||||
COLLECT (IF (FINDFILE (PACKFILENAME 'BODY F 'EXTENSION 'TXT)
|
||||
T UNICODEDIRECTORIES)
|
||||
@@ -412,24 +517,24 @@
|
||||
ELSE F])
|
||||
|
||||
(READ-UNICODE-MAPPING
|
||||
(MAKE-EXTERNALFORMAT :UTF-16BE (FUNCTION UTF16BE.INCCODEFN)
|
||||
[LAMBDA (FILESPEC NOPRINT NOERROR) (* ; "Edited 3-Jul-2021 13:37 by rmk:")
|
||||
|
||||
(FUNCTION \UTF16.BACKCCODEFN)
|
||||
(* ;; "Combines the char-mapping tables from FILES coded in the Uncode-CDROM format. Comments prefixed by # and")
|
||||
|
||||
NIL EXTERNALEOL)
|
||||
(* ;; " Column 1: Input hex code in the format 0xXXXX")
|
||||
|
||||
(UTF16BE.INCCODEFN STREAM COUNTP T]
|
||||
(* ;; " Column 2: Corresponding Unicode code-sequence in the format")
|
||||
|
||||
(UTF16BE.PEEKCCODEFN STREAM NOERROR T]
|
||||
(* ;; " 0xXXXX ... 0xYYYY")
|
||||
|
||||
[FUNCTION (LAMBDA (STREAM CHARCODE)
|
||||
(UTF16BE.OUTCHARFN STREAM CHARCODE T]
|
||||
(* ;;
|
||||
" Column 3: (after #) Character name in some mapping files, utf-8 character")
|
||||
|
||||
)
|
||||
(* ;; " for XCCS mapping files")
|
||||
|
||||
(MAKE-UNICODE-FORMATS EXTERNALEOL)
|
||||
(* ;; "")
|
||||
|
||||
(ADDTOVAR *DEFAULT-EXTERNALFORMATS* (UNIX :UTF-8))
|
||||
(* ;; "Result is a list of (fromcode tocode1 ... tocoden) integer lists (almost always with only a single tocode")
|
||||
|
||||
(FOR FILE [SEPBITTABLE _ (MAKEBITTABLE (CHARCODE (TAB SPACE] IN (
|
||||
READ-UNICODE-MAPPING-FILENAMES
|
||||
@@ -461,18 +566,18 @@
|
||||
(NTHCHARCODE LINE START])
|
||||
|
||||
(WRITE-UNICODE-MAPPING
|
||||
(CL:WHEN (AND (STRPOS "XCCS-" (U-CASE (FULLNAME STREAM)))
|
||||
[LAMBDA (MAPPING INCLUDECHARSETS FILE EMPTYOK) (* ; "Edited 16-Aug-2020 16:56 by rmk:")
|
||||
|
||||
'EXTENSION]
|
||||
(* ;; "Writes a symbol unicode mapping file. Mapping is a list of (XCCS-code Unicode) pairs, which may contain codes in multiple character sets.")
|
||||
|
||||
(STREAMPROP STREAM 'EXTERNALFORMAT :UTF8))])
|
||||
(* ;; "If FILE is NIL, it defaults to a name XCCS- followed by the octal character sets in the mapping, in the unicode/XEROX directory.")
|
||||
|
||||
(DECLARE%: EVAL@COMPILE DONTCOPY
|
||||
(* ;; "The output lines are of the form x0XXX<tab>x0UUUU<tab># Unicode-char")
|
||||
|
||||
|
||||
(PUTPROPS UNICODE.TRANSLATE MACRO [OPENLAMBDA (CODE TRANSLATION-TABLE)
|
||||
(* ;;
|
||||
"If INCLUDECHARSETS=T then the mappings are split up into separate per-character set files.")
|
||||
|
||||
TRANSLATION-SHIFT
|
||||
(* ;; "Otherwise, all and only mappings included in thos charsets are included in a single output file--an implicit subset.")
|
||||
|
||||
(IF (AND (EQ INCLUDECHARSETS T)
|
||||
(NULL FILE))
|
||||
@@ -513,15 +618,15 @@
|
||||
" # "
|
||||
(SELECTC FIRSTRIGHTC
|
||||
(UNDEFINEDCODE
|
||||
(CADR CSI))
|
||||
(* ;; "FFFF")
|
||||
|
||||
"UNDEFINED")
|
||||
(MISSINGCODE
|
||||
ELSE F])
|
||||
(* ;; "FFFE")
|
||||
|
||||
"MISSING")
|
||||
(IF (ILESSP FIRSTRIGHTC 32)
|
||||
|
||||
THEN (* ; "Control chars")
|
||||
[CONCAT "^" (CHARACTER (IPLUS FIRSTRIGHTC
|
||||
(CHARCODE @]
|
||||
ELSE (CHARACTER FIRSTRIGHTC)))
|
||||
@@ -535,13 +640,13 @@
|
||||
NIL])
|
||||
|
||||
(WRITE-UNICODE-INCLUDED
|
||||
(* ;; "")
|
||||
[LAMBDA (MAPPING INCLUDECHARSETS) (* ; "Edited 4-Aug-2020 17:47 by rmk:")
|
||||
|
||||
(* ;; "Result is a list of (fromcode tocode1 ... tocoden) integer lists (almost always with only a single tocode")
|
||||
(* ;; "CSETINFO is a list of (num string name) for each included character set.")
|
||||
|
||||
(LET (CHARSETS CSETINFO RANGES ICSETS IMAPPING)
|
||||
|
||||
FILESPEC)
|
||||
(* ;; "Normalize the INCLUDECHARSETS, then reduce MAPPING to the included mappings")
|
||||
|
||||
[SETQ ICSETS (FOR C POS KNOWN INSIDE (OR INCLUDECHARSETS (FOR CSI IN
|
||||
XCCS-SET-NAMES
|
||||
@@ -569,13 +674,13 @@
|
||||
ICSETS))
|
||||
COLLECT
|
||||
|
||||
[LAMBDA (MAPPING INCLUDECHARSETS FILE EMPTYOK) (* ; "Edited 16-Aug-2020 16:56 by rmk:")
|
||||
(* ;; "The attested subset of INCLUDED")
|
||||
|
||||
(CL:UNLESS (MEMB CSI CSETINFO)
|
||||
(PUSH CSETINFO CSI))
|
||||
M))
|
||||
|
||||
(* ;; "The output lines are of the form x0XXX<tab>x0UUUU<tab># Unicode-char")
|
||||
(* ;; "Sort as numbers, not octal strings, then group into consecutive ranges")
|
||||
|
||||
(SETQ CSETINFO (SORT CSETINFO T))
|
||||
[SETQ RANGES (FOR CTAIL C START END ON (FOR CSI IN CSETINFO
|
||||
@@ -587,7 +692,7 @@
|
||||
COLLECT (SETQ CTAIL (CDR CTAIL))
|
||||
(SETQ END (CAR CTAIL]
|
||||
|
||||
MAPPING
|
||||
(* ;; "Split out groups of less than 3. But if a range exhaustively covers a known subset (like JIS), replace by the name")
|
||||
|
||||
[SETQ RANGES (FOR R STR KNOWN LAST IN RANGES
|
||||
JOIN (SETQ LAST (CAR (LAST R)))
|
||||
@@ -607,9 +712,9 @@
|
||||
(CL:VALUES IMAPPING CSETINFO RANGES])
|
||||
|
||||
(WRITE-UNICODE-MAPPING-HEADER
|
||||
(CL:UNLESS (EQ CSET (LRSH LEFTC 8))
|
||||
[LAMBDA (STREAM CSETINFO RANGES) (* ; "Edited 4-Aug-2020 17:38 by rmk:")
|
||||
|
||||
(SETQ CSI (ASSOC CSET CSETINFO))
|
||||
(* ;; "Writes the standard per-file header information")
|
||||
|
||||
(FOR LINE IN UNICODE-MAPPING-HEADER
|
||||
DO (PRINTOUT STREAM "#" 2)
|
||||
@@ -620,7 +725,7 @@
|
||||
THEN (PRINTOUT STREAM "s:" -4)
|
||||
(FOR R IN RANGES DO (PRINTOUT STREAM R " "))
|
||||
(TERPRI STREAM)
|
||||
(UNDEFINEDCODE
|
||||
ELSE (* ; "Singleton")
|
||||
(PRINTOUT STREAM ": " -4 (CADAR CSETINFO)
|
||||
" "
|
||||
(CADDAR CSETINFO)))
|
||||
@@ -632,7 +737,7 @@
|
||||
(TERPRI STREAM])
|
||||
|
||||
(WRITE-UNICODE-MAPPING-FILENAME
|
||||
ELSE (CHARACTER FIRSTRIGHTC)))
|
||||
[LAMBDA (FILE CSETINFO RANGES) (* ; "Edited 4-Aug-2020 19:34 by rmk:")
|
||||
(PACKFILENAME 'BODY [OR FILE (CONCATLIST
|
||||
(CONS 'XCCS- (IF (CDR CSETINFO)
|
||||
THEN (FOR RTAIL R ON RANGES
|
||||
@@ -736,53 +841,53 @@
|
||||
(DEFINEQ
|
||||
|
||||
(MAKE-UNICODE-TRANSLATION-TABLES
|
||||
(PRINTOUT STREAM LINE T)))
|
||||
(TERPRI STREAM])
|
||||
[LAMBDA (MAPPING LTORVAR RTOLVAR) (* ; "Edited 21-Aug-2021 13:12 by rmk:")
|
||||
(* ; "Edited 17-Aug-2020 08:46 by rmk:")
|
||||
|
||||
(WRITE-UNICODE-MAPPING-FILENAME
|
||||
(* ;; "MAPPING is the list of numeric code correspondence pairs constructed by applying READ-UNICODE-MAPPING to a Unicode mapping file.")
|
||||
|
||||
(PACKFILENAME 'BODY [OR FILE (CONCATLIST
|
||||
(* ;; "This produces two recoding arrays, one maps left-side codes into right-side codes (e.g. XCCS or ISO8859-1 to Unicode), for printing, the other maps right-side (Unicode) codes to corresponding right-side codes (e.g. XCCS).")
|
||||
|
||||
THEN (FOR RTAIL R ON RANGES
|
||||
(* ;; "")
|
||||
|
||||
(SETQ R
|
||||
(* ;; "We assume that the left-to-right mapping into Unicode is functional, so that each left code maps to a unique right (Unicode) code, because Unicode is presumably the most refined coding scheme. But several Unicode codes may map to the same left code, for logically different codes that happen to have the same glyphs. In that case the heuristic is to map each %"from%" code to the lowest of the possible %"to%" codes. This means that round-trip reading/writing or writing/reading from one or both starting points may not always be lossless.")
|
||||
|
||||
(LIST (CAR R)
|
||||
(* ;; " ")
|
||||
|
||||
(CDR R))
|
||||
(* ;; " Each recoding array has 256 elements, one for each possible high-order byte of a character code. An array entry is either NIL, a 256-array of codes indexed by low-order bytes, or an alist of (lower-order-bytes . codes). The latter is used to save space for sparsely populated character sets.")
|
||||
|
||||
(CL:IF (CDR RTAIL)
|
||||
(* ;; "")
|
||||
|
||||
R)
|
||||
(* ;; "The element 256 of each array contains a hash table for characters that might be encountered in XCCS memory or Unicode files for which there is no mapping. Element 257 contains the corresponding inverse unmapped hash-array, so that UNICODE.TRANSLATE can update them consistently.")
|
||||
|
||||
"="
|
||||
(* ;; "")
|
||||
|
||||
'DIRECTORY
|
||||
(* ;; "UNICODE.TRANSLATE assigns an unmapped Unicode character to a %"not used%" XCCS code position (from 5,0 to 40,FF, leaving other low not-used sets for other internal uses (TEDIT?).")
|
||||
|
||||
'EXTENSION
|
||||
(* ;; "")
|
||||
|
||||
)
|
||||
|
||||
(* ;;
|
||||
"An unmapped XCCS character is assigned a code in the %"private use%" code blocks 0xE000-F8FF")
|
||||
|
||||
(("0" LATIN)
|
||||
(* ;; "")
|
||||
|
||||
("42" SYMBOLS2)
|
||||
(* ;; "For the convenience of not having to deal with the multiple values, if LTORVAR or RTOLVAR are given, they are set to the constructed arrays before return.")
|
||||
|
||||
("44" HIRAGANA)
|
||||
(* ;; "")
|
||||
|
||||
(LET ((LTORARRAY (CL:MAKE-ARRAY (IPLUS 2 N-TRANSLATION-SEGMENTS)
|
||||
:INITIAL-ELEMENT NIL))
|
||||
(RTOLARRAY (CL:MAKE-ARRAY (IPLUS 2 N-TRANSLATION-SEGMENTS)
|
||||
:INITIAL-ELEMENT NIL)))
|
||||
|
||||
("341" HEBREW)
|
||||
(* ;; "The left-to-right direction (into Unicode). We start by distributing the mappings into alists in arrays indexed by the higher-order (charaset set byte). The second loop converts long alists into arrays.")
|
||||
|
||||
[FOR M LEFTC RBASE RCODES IN MAPPING EACHTIME (SETQ RCODES (CDR M))
|
||||
(SETQ RBASE (CAR RCODES))
|
||||
UNLESS (IGEQ RBASE MISSINGCODE) DO (SETQ LEFTC (CAR M))
|
||||
|
||||
("360" LIGATURES)
|
||||
("361" ACCENTED-LATIN)
|
||||
(* ;;
|
||||
"(CDR RCODES) contains combiners on the base")
|
||||
|
||||
(CL:PUSH (CONS (LOGAND LEFTC TRANSLATION-MASK)
|
||||
(CL:IF (CDR RCODES)
|
||||
@@ -796,7 +901,7 @@
|
||||
MAX-ALIST-LENGTH)
|
||||
DO
|
||||
|
||||
|
||||
(* ;; "Leave it alone if the alist is short")
|
||||
|
||||
(SETQ CSA (CL:MAKE-ARRAY TRANSLATION-SEGMENT-SIZE :INITIAL-ELEMENT NIL))
|
||||
(FOR P IN (CL:SVREF LTORARRAY I)
|
||||
@@ -806,17 +911,17 @@
|
||||
(CL:SETF (CL:SVREF LTORARRAY I)
|
||||
CSA))
|
||||
|
||||
DATE " Author: Ron Kaplan <Ron.Kaplan@post.harvard.edu>" ""
|
||||
(* ;; "")
|
||||
|
||||
"XC1-3-3-0, 1987) into Unicode 3.0. standard codes. That is the version of"
|
||||
(* ;; "Now the right-to-left direction (from Unicode). Here we have to detect and compensate for ambiguity.")
|
||||
|
||||
(FOR M LEFTC RBASE RCOMBINERS PREV IN MAPPING EACHTIME (SETQ RBASE (CADR M))
|
||||
(SETQ RCOMBINERS (CDDR M))
|
||||
UNLESS (OR (IGEQ RBASE MISSINGCODE)
|
||||
RCOMBINERS) DO
|
||||
|
||||
" Unicode character itself (since the Unicode character names"
|
||||
" are not available)"
|
||||
(* ;;
|
||||
"Have we already seen an explicit mapping from right to left?")
|
||||
|
||||
(SETQ LEFTC (CAR M))
|
||||
[SETQ PREV (ASSOC (LOGAND RBASE TRANSLATION-MASK)
|
||||
@@ -838,7 +943,7 @@
|
||||
MAX-ALIST-LENGTH)
|
||||
DO
|
||||
|
||||
|
||||
(* ;; "Long list, make an array")
|
||||
|
||||
(SETQ CSA (CL:MAKE-ARRAY TRANSLATION-SEGMENT-SIZE :INITIAL-ELEMENT NIL))
|
||||
(FOR P IN (CL:SVREF RTOLARRAY I)
|
||||
@@ -848,9 +953,9 @@
|
||||
(CL:SETF (CL:SVREF RTOLARRAY I)
|
||||
CSA))
|
||||
|
||||
|
||||
(* ;; "")
|
||||
|
||||
|
||||
(* ;; "Allocate the hash arrays for future out-of-map codes. We we have to keep track of the next available and last possible codes, as well as the first available, for error checking.")
|
||||
|
||||
(CL:SETF (CL:SVREF LTORARRAY N-TRANSLATION-SEGMENTS)
|
||||
(LIST (HASHARRAY 10)
|
||||
@@ -863,14 +968,14 @@
|
||||
(CHARCODE.DECODE "U+F8FF")
|
||||
(CHARCODE.DECODE "U+E000")))
|
||||
|
||||
(* ;; "")
|
||||
(* ;; "Now put in the inverse unmapped hash arrays")
|
||||
|
||||
(CL:SETF (CL:SVREF LTORARRAY (ADD1 N-TRANSLATION-SEGMENTS))
|
||||
(CL:SVREF RTOLARRAY N-TRANSLATION-SEGMENTS))
|
||||
(CL:SETF (CL:SVREF RTOLARRAY (ADD1 N-TRANSLATION-SEGMENTS))
|
||||
(CL:SVREF LTORARRAY N-TRANSLATION-SEGMENTS))
|
||||
|
||||
"An unmapped XCCS character is assigned a code in the %"private use%" code blocks 0xE000-F8FF")
|
||||
(* ;; "")
|
||||
|
||||
(CL:WHEN LTORVAR (SETATOMVAL LTORVAR LTORARRAY))
|
||||
(CL:WHEN RTOLVAR (SETATOMVAL RTOLVAR RTOLARRAY))
|
||||
@@ -892,11 +997,11 @@
|
||||
(DEFINEQ
|
||||
|
||||
(HEXSTRING
|
||||
(CL:PUSH (CONS (LOGAND LEFTC TRANSLATION-MASK)
|
||||
(CL:IF (CDR RCODES)
|
||||
[LAMBDA (N WIDTH) (* ; "Edited 23-Jul-2020 08:28 by rmk:")
|
||||
(* ; "Edited 20-Dec-93 17:51 by rmk:")
|
||||
|
||||
RBASE))
|
||||
(CL:SVREF LTORARRAY (LRSH LEFTC
|
||||
(* ;;
|
||||
"Converts positive numbers to Hex strings, padding on the right with 0 up to WIDTH if given.")
|
||||
|
||||
(CL:UNLESS (FIXP N)
|
||||
(SETQ N (CHARCODE.DECODE N)))
|
||||
@@ -915,21 +1020,21 @@
|
||||
STR])
|
||||
|
||||
(UTF8HEXSTRING
|
||||
|
||||
[LAMBDA (CHARCODE) (* ; "Edited 10-Aug-2020 08:33 by rmk:")
|
||||
|
||||
|
||||
(* ;; "Utility to produces the UTF8 hexstring representing CODE")
|
||||
|
||||
(HEXSTRING (IF (ILESSP CHARCODE 128)
|
||||
THEN CHARCODE
|
||||
ELSEIF (ILESSP CHARCODE 2048)
|
||||
|
||||
THEN (* ; "x800")
|
||||
(LOGOR (LLSH (LOGOR (LLSH 3 6)
|
||||
(LRSH CHARCODE 6))
|
||||
8)
|
||||
(LOGOR (LLSH 2 6)
|
||||
(LOADBYTE CHARCODE 0 6)))
|
||||
ELSEIF (ILESSP CHARCODE 65536)
|
||||
TRANSLATION-SHIFT
|
||||
THEN (* ; "x10000")
|
||||
(LOGOR (LLSH (LOGOR (LLSH 7 5)
|
||||
(LRSH CHARCODE 12))
|
||||
16)
|
||||
@@ -939,7 +1044,7 @@
|
||||
(LOGOR (LLSH 2 6)
|
||||
(LOADBYTE CHARCODE 0 6)))
|
||||
ELSEIF (ILESSP CHARCODE 2097152)
|
||||
LEFTC)
|
||||
THEN (* ; "x200000")
|
||||
(LOGOR (LLSH (LOGOR (LLSH 15 4)
|
||||
(LRSH CHARCODE 18))
|
||||
24)
|
||||
@@ -954,27 +1059,27 @@
|
||||
ELSE (ERROR "CHARCODE too big for UTF8" CHARCODE])
|
||||
|
||||
(NUTF8CODEBYTES
|
||||
CSA))
|
||||
[LAMBDA (N) (* ; "Edited 10-Aug-2020 12:35 by rmk:")
|
||||
|
||||
(* ;; "")
|
||||
(* ;; "Returns the number of bytes needed to encode N in UTF8, ")
|
||||
|
||||
(IF (ILESSP N 128)
|
||||
THEN 1
|
||||
ELSEIF (ILESSP N 2048)
|
||||
(LIST (HASHARRAY 10)
|
||||
THEN (* ; "x800")
|
||||
4
|
||||
ELSEIF (ILESSP N 65536)
|
||||
(CHARCODE.DECODE "5,0")))
|
||||
THEN (* ; "x10000")
|
||||
3
|
||||
ELSEIF (ILESSP N 2097152)
|
||||
(CHARCODE.DECODE "U+E000")
|
||||
THEN (* ; "x200000")
|
||||
2
|
||||
ELSE (SHOULDNT])
|
||||
|
||||
(NUTF8STRINGBYTES
|
||||
|
||||
[LAMBDA (STRING RAWFLG) (* ; "Edited 10-Aug-2020 09:06 by rmk:")
|
||||
|
||||
(CL:SVREF RTOLARRAY N-TRANSLATION-SEGMENTS))
|
||||
(* ;; "Returns the number of bytes it would take to represent STRING in UTF8, assuming it is an XCCS string unless RAWFLG. ")
|
||||
|
||||
(FOR I C FROM 1 WHILE (SETQ C (NTHCHARCODE STRING I))
|
||||
SUM (NUTF8CODEBYTES (CL:IF RAWFLG
|
||||
@@ -982,11 +1087,11 @@
|
||||
(XTOUCODE C))])
|
||||
|
||||
(XTOUSTRING
|
||||
(LIST LTORARRAY RTOLARRAY])
|
||||
[LAMBDA (XCCSSTRING RAWFLG) (* ; "Edited 10-Aug-2020 21:42 by rmk:")
|
||||
|
||||
|
||||
(* ;; "Produces a string that contains the UTF8 bytes that represent the characters in XCCSSTRING. Applies the XCCSTOUNICODE translation unless RAWFLG. ")
|
||||
|
||||
ACCENTED-LATIN GREEK))
|
||||
(* ;; "The resulting string will not be readable inside Medley.")
|
||||
|
||||
(LET [(USTR (ALLOCSTRING (NUTF8STRINGBYTES XCCSSTRING RAWFLG]
|
||||
(FOR I CHARCODE (SINDEX _ 0) FROM 1 WHILE (SETQ CHARCODE (NTHCHARCODE XCCSSTRING
|
||||
@@ -997,7 +1102,7 @@
|
||||
THEN (RPLCHARCODE USTR (ADD SINDEX 1)
|
||||
CHARCODE)
|
||||
ELSEIF (ILESSP CHARCODE 2048)
|
||||
(DEFINEQ
|
||||
THEN (* ; "x800")
|
||||
(RPLCHARCODE USTR (ADD SINDEX 1)
|
||||
(LOGOR (LLSH 3 6)
|
||||
(LRSH CHARCODE 6)))
|
||||
@@ -1005,7 +1110,7 @@
|
||||
(LOGOR (LLSH 2 6)
|
||||
(LOADBYTE CHARCODE 0 6)))
|
||||
ELSEIF (ILESSP CHARCODE 65536)
|
||||
|
||||
THEN (* ; "x10000")
|
||||
(RPLCHARCODE USTR (ADD SINDEX 1)
|
||||
(LOGOR (LLSH 7 5)
|
||||
(LRSH CHARCODE 12)))
|
||||
@@ -1016,7 +1121,7 @@
|
||||
(LOGOR (LLSH 2 6)
|
||||
(LOADBYTE CHARCODE 0 6)))
|
||||
ELSEIF (ILESSP CHARCODE 2097152)
|
||||
THEN (+ CHAR (CHARCODE 0))
|
||||
THEN (* ; "x200000")
|
||||
(RPLCHARCODE USTR (ADD SINDEX 1)
|
||||
(LOGOR (LLSH 15 4)
|
||||
(LRSH CHARCODE 18)))
|
||||
@@ -1033,9 +1138,9 @@
|
||||
USTR])
|
||||
|
||||
(XCCSSTRING
|
||||
8)
|
||||
[LAMBDA (CODE) (* ; "Edited 13-Aug-2020 12:16 by rmk:")
|
||||
|
||||
(LOADBYTE CHARCODE 0 6)))
|
||||
(* ;; "Returns XCCS character representation of string %"cset,char%"")
|
||||
|
||||
(CL:UNLESS (FIXP CODE)
|
||||
(SETQ CODE (CHCON1 CODE)))
|
||||
@@ -1046,14 +1151,14 @@
|
||||
(DEFINEQ
|
||||
|
||||
(SHOWCHARS
|
||||
ELSEIF (ILESSP CHARCODE 2097152)
|
||||
[LAMBDA (FROMCHAR TOCHAR FONT) (* ; "Edited 1-Aug-2020 09:27 by rmk:")
|
||||
(RESETFORM (DSPFONT (OR FONT '(CLASSIC 12))
|
||||
T)
|
||||
(CL:WHEN (AND (SMALLP FROMCHAR)
|
||||
(NOT TOCHAR))
|
||||
|
||||
(LOADBYTE CHARCODE 12 6))
|
||||
16)
|
||||
(* ;;
|
||||
"If a small number, assume it's an octal (in decimal) character set, no need for string quotes")
|
||||
|
||||
(SETQ TOCHAR (CONCAT FROMCHAR "," 376))
|
||||
(SETQ FROMCHAR (CONCAT FROMCHAR "," 41)))
|
||||
@@ -1100,15 +1205,15 @@
|
||||
)
|
||||
)
|
||||
(DECLARE%: DONTCOPY
|
||||
(SETQ CHARCODE (XTOUCODE CHARCODE)))
|
||||
(IF (ILESSP CHARCODE 128)
|
||||
THEN (RPLCHARCODE USTR (ADD SINDEX 1)
|
||||
CHARCODE)
|
||||
ELSEIF (ILESSP CHARCODE 2048)
|
||||
THEN (* ; "x800")
|
||||
(RPLCHARCODE USTR (ADD SINDEX 1)
|
||||
(LOGOR (LLSH 3 6)
|
||||
(LRSH CHARCODE 6)))
|
||||
(RPLCHARCODE USTR (ADD SINDEX 1)
|
||||
(LOGOR (LLSH 2 6)
|
||||
(FILEMAP (NIL (4046 17726 (UTF8.OUTCHARFN 4056 . 6887) (UTF8.INCCODEFN 6889 . 12379) (UTF8.PEEKCCODEFN
|
||||
12381 . 17155) (\UTF8.BACKCCODEFN 17157 . 17724)) (17727 21053 (UTF16BE.OUTCHARFN 17737 . 18561) (
|
||||
UTF16BE.INCCODEFN 18563 . 19462) (UTF16BE.PEEKCCODEFN 19464 . 20535) (\UTF16.BACKCCODEFN 20537 . 21051
|
||||
)) (21083 22891 (MAKE-UNICODE-FORMATS 21093 . 22889)) (22988 24294 (UNICODE.UNMAPPED 22998 . 24292)) (
|
||||
24295 24831 (XCCS-UTF8-AFTER-OPEN 24305 . 24829)) (25901 26250 (XTOUCODE 25911 . 26079) (UTOXCODE
|
||||
26081 . 26248)) (26290 42412 (READ-UNICODE-MAPPING-FILENAMES 26300 . 27401) (READ-UNICODE-MAPPING
|
||||
27403 . 30701) (WRITE-UNICODE-MAPPING 30703 . 34920) (WRITE-UNICODE-INCLUDED 34922 . 39644) (
|
||||
WRITE-UNICODE-MAPPING-HEADER 39646 . 40878) (WRITE-UNICODE-MAPPING-FILENAME 40880 . 42410)) (45749
|
||||
54228 (MAKE-UNICODE-TRANSLATION-TABLES 45759 . 54226)) (54649 62553 (HEXSTRING 54659 . 55820) (
|
||||
UTF8HEXSTRING 55822 . 58027) (NUTF8CODEBYTES 58029 . 58692) (NUTF8STRINGBYTES 58694 . 59175) (
|
||||
XTOUSTRING 59177 . 62188) (XCCSSTRING 62190 . 62551)) (62554 64023 (SHOWCHARS 62564 . 64021)))))
|
||||
STOP
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user