--- gforth/utf-8.fs 2007/09/15 20:11:44 1.29 +++ gforth/utf-8.fs 2007/10/17 16:05:22 1.32 @@ -293,7 +293,7 @@ here wc-table - Constant #wc-table ['] u8\string- is xstring- ['] +u8/string is +xstring [ [THEN] ] -[ [IFDEF] x/string+ ] +[ [IFDEF] +x/string ] ['] u8\string- is x\string- ['] +u8/string is +x/string [ [THEN] ] @@ -318,6 +318,16 @@ here wc-table - Constant #wc-table s" UTF-8" search nip nip IF set-encoding-utf-8 ELSE set-encoding-fixed-width THEN ; +environment-wordlist set-current +: xchar-encoding ( -- addr u ) \ xchar-ext + \G Returns a printable ASCII string that reperesents the encoding, + \G and use the preferred MIME name (if any) or the name in + \G @url{http://www.iana.org/assignments/character-sets} like + \G ``ISO-LATIN-1'' or ``UTF-8'', with the exception of ``ASCII'', where + \G we prefer the alias ``ASCII''. + max-single-byte $80 = IF s" UTF-8" ELSE s" ISO-LATIN-1" THEN ; +forth definitions + :noname ( -- ) defers 'cold utf-8-cold