Re: Bug#354640: tidy -utf8 -raw or else wrapping wacko on wide chars

Dan Jacobson <[email protected]> Tue, 07 Mar 2006 04:55:12 +0800
Newsgroups gmane.comp.web.html-tidy.devel
Message-ID <[email protected]>
I discovered I needed -raw all along for correct wrapping of lines
with some wide cars. Worked in combination -big5, but with -utf8, my
luck ran out. I could no longer avoid the bug.

Anyways, for I'll sneak UTF-8 past tidy with:
#!/bin/sh -e
perl -C -pwe 's/[^[:ascii:]]/sprintf "\\x{%04x}",ord $&/ge'|#homebrew uni2ascii(1)
tidy --gnu-emacs yes --indent-spaces 1 --indent auto -utf8 \
--tidy-mark no --wrap-attributes yes --wrap-script-literals yes -quiet|
perl -C -pwe 's/\\x\{([[:xdigit:]]{4})\}/chr eval "0x$1"/eg'#homebrew ascii2uni

I.e., Chinese now is treated as \x{....} = 8 characters wide instead
of 2, but wrapping early is better than wrapping late causing two
lines on my screen.


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642