--- gforth/utf-8.fs 2006/02/19 22:15:05 1.20 +++ gforth/utf-8.fs 2006/02/20 08:22:28 1.22 @@ -128,9 +128,13 @@ $80 Value max-single-byte nip nip over - then ; +[IFUNDEF] wcwidth + : wcwidth abort ; +[THEN] + : u8width ( xcaddr u -- n ) 0 rot rot over + swap ?DO - I xc@+ swap >r wcwidth + + I xc@+ swap >r wcwidth + r> I - +LOOP ; : set-encoding-utf-8 ( -- )