;		Character-encoding module
;
; This module deals with particular character-encoding issues such as
; conversions between characters and their ASCII or UCS2 codes, Scheme
  representations of " Carriage Return " ( CR ) , " tabulation " ( TAB ) and
; other control characters.
;
; This module by necessity is platform-specific as character encoding
  issues are hardly addressed in R5RS . For example , the result of
; char->integer is generally not an ASCII code of an integer (although
; it is, on many Scheme systems, with the important exception of
; Scheme48 and SCSH). The level of support for character sets other
; than ASCII varies widely among Scheme systems.
;
; This file collects various character-encoding functions that are
; necessary for the SSAX XML parser. The functions are of general use
; and scope.
;
  $ I d : char - encoding.scm , v 1.1 2003/04/09 20:34:28 oleg Exp $


	 ascii->char INT - > 
  return a character whose ASCII code is 
; Note, because ascii->char is injective (there are more characters than
; ASCII characters), the inverse transformation is not defined.
(cond-expand
  (scheme48  #f)		; ascii->char is built into Scheme48
  (scsh #f)			; ascii->char is built into Scheme48
  (else
    (define ascii->char integer->char)
  )
)


	 ucscode->char INT - > 
  Return a character whose UCS ( ISO / IEC 10646 ) code is INT
; Note
  This function is required for processing of XML character entities :
; According to Section "4.1 Character and Entity References"
  of the XML Recommendation :
;  "[Definition: A character reference refers to a specific character
;   in the ISO/IEC 10646 character set, for example one not directly
;   accessible from available input devices.]"

(define (ucscode->char code)
  (cond-expand
    (bigloo
      (ucs2->char (integer->ucs2 code)))
  Scheme48 has no support for UCS
      (ascii->char code))
    (else
      (integer->char code))))

  Commonly used control characters

(define char-return (ascii->char 13))
(define char-tab    (ascii->char 9))
  a.k.a . # \newline , per R5RS

		Character-encoding module

 This module deals with particular character-encoding issues such as
 conversions between characters and their ASCII or UCS2 codes, Scheme
 other control characters.

 This module by necessity is platform-specific as character encoding
 char->integer is generally not an ASCII code of an integer (although
 it is, on many Scheme systems, with the important exception of
 Scheme48 and SCSH). The level of support for character sets other
 than ASCII varies widely among Scheme systems.

 This file collects various character-encoding functions that are
 necessary for the SSAX XML parser. The functions are of general use
 and scope.

 Note, because ascii->char is injective (there are more characters than
 ASCII characters), the inverse transformation is not defined.
 ascii->char is built into Scheme48
 ascii->char is built into Scheme48
 Note
 According to Section "4.1 Character and Entity References"
  "[Definition: A character reference refers to a specific character
   in the ISO/IEC 10646 character set, for example one not directly
   accessible from available input devices.]"
  representations of " Carriage Return " ( CR ) , " tabulation " ( TAB ) and
  issues are hardly addressed in R5RS . For example , the result of
  $ I d : char - encoding.scm , v 1.1 2003/04/09 20:34:28 oleg Exp $


	 ascii->char INT - > 
  return a character whose ASCII code is 
(cond-expand
  (else
    (define ascii->char integer->char)
  )
)


	 ucscode->char INT - > 
  Return a character whose UCS ( ISO / IEC 10646 ) code is INT
  This function is required for processing of XML character entities :
  of the XML Recommendation :

(define (ucscode->char code)
  (cond-expand
    (bigloo
      (ucs2->char (integer->ucs2 code)))
  Scheme48 has no support for UCS
      (ascii->char code))
    (else
      (integer->char code))))

  Commonly used control characters

(define char-return (ascii->char 13))
(define char-tab    (ascii->char 9))
  a.k.a . # \newline , per R5RS
