--- gforth/wf.fs 2006/01/31 17:08:07 1.42 +++ gforth/wf.fs 2006/10/11 19:18:51 1.49 @@ -31,6 +31,7 @@ require string.fs : parse" ( -- addr u ) '" parse 2drop '" parse ; : .' '' parse postpone SLiteral postpone type ; immediate : s' '' parse postpone SLiteral ; immediate +: .upcase ( addr u -- ) bounds ?DO I c@ toupper emit LOOP ; \ character recoding @@ -42,7 +43,7 @@ require string.fs case '& of ." &" endof '< of ." <" endof -\ '¤ of ." €" endof +\ &164 of ." €" endof dup emit endcase LOOP ; @@ -67,7 +68,11 @@ s" " default-class $! : tagged ( addr1 u1 addr2 u2 -- ) 2dup 2>r tag .type 2r> /tag ; : opt ( addr u opt u -- ) s" " tag-option $+! - tag-option $+! s' ="' tag-option $+! tag-option $+! + tag-option $+! s' ="' tag-option $+! +\ BEGIN dup WHILE '& $split >r >r tag-option $+! r> r> +\ dup IF s" %26" tag-option $+! THEN +\ REPEAT 2drop + tag-option $+! s' "' tag-option $+! ; : n>string ( n -- addr u ) 0 <# #S #> ; : xy>string ( x y -- ) swap 0 <# #S 'x hold 2drop 0 #S 's hold #> ; @@ -655,7 +660,9 @@ definitions Variable css-file Variable print-file +Variable ie-css-file Variable content +Variable _charset Variable _lang Variable _favicon @@ -666,14 +673,21 @@ Variable _favicon s" StyleSheet" s" rel" opt css-file $@ href= s" screen" s" media" opt s" text/css" s" type" opt s" link" tag/ cr - THEN THEN ; + THEN THEN + ie-css-file @ IF + ." " cr + THEN ; : .print ( -- ) print-file @ IF print-file $@len IF - s" StyleSheet" s" rel" opt - print-file $@ href= s" print" s" media" opt - s" text/css" s" type" opt s" link" tag/ cr - THEN THEN ; + s" StyleSheet" s" rel" opt + print-file $@ href= s" print" s" media" opt + s" text/css" s" type" opt s" link" tag/ cr + THEN THEN ; : .title ( addr u -- ) 1 envs ! oldenv off + _charset $@ s" utf-8" str= 0= + IF .' ' cr THEN .' ' cr @@ -722,7 +736,7 @@ Variable orig-date : pgp-key ( -- ) bl sword -trailing public-key $! ; : charset ( -- ) s" text/xhtml; charset=" content $! - bl sword -trailing content $+! ; + bl sword -trailing 2dup content $+! _charset $! ; charset iso-8859-1 @@ -752,6 +766,7 @@ Variable style$ : marginheight ( -- ) parse" s" marginheight" style ; : css ( -- ) parse" css-file $! ; : print-css ( -- ) parse" print-file $! ; +: ie-css ( -- ) parse" ie-css-file $! ; : wf ( -- ) outfile-id >r