[gentoo-user] use CGI::FormBuilder::Multi; ...

2015-08-21 Thread hw


Hi,

any idea why Umlaute are not displayed correctly when they appear in 
text generated from the FormBuilder module?


When looking at the source of the form in the web browser, it has:


?xml version=1.0 encoding=utf-8?
!DOCTYPE html
PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
html xmlns=http://www.w3.org/1999/xhtml; lang=de_DE xml:lang=de_DE

head
titleJobnummer erzeugen/title
link href=/styles/cgiforms.css rel=stylesheet type=text/css /
script type=text/javascript!-- hide from old browsers
[...]

/script
/head
body
h3Jobnummer erzeugen/h3
noscriptspan class=fb_invalidBitte aktivieren Sie JavaScript oder 
benutzen Sie einen neueren Webbrowser./span/noscript
pSie m�ssen Angaben f�r die span 
class=fb_requiredhervorgehobenen/span Felder machen./p

[...]


So the header says the encoding is UTF-8.  The message template is also 
UTF-8:


sunflo cgi-bin # file 
/usr/lib/perl5/vendor_perl/5.20.1/CGI/FormBuilder/Messages/de.pm
/usr/lib/perl5/vendor_perl/5.20.1/CGI/FormBuilder/Messages/de.pm: Perl5 
module source, UTF-8 Unicode text

sunflo cgi-bin #


Text with Umlauten I put myself into the form, like field labels, are 
shown correctly.  I have put '@charset utf-8;' at the beginning of the 
style sheet, but it doesn't help.


How could I fix this problem?



Re: [gentoo-user] use CGI::FormBuilder::Multi; ...

2015-08-21 Thread Fernando Rodriguez
On Friday, August 21, 2015 12:36:59 PM hw wrote:
 
 Hi,
 
 any idea why Umlaute are not displayed correctly when they appear in 
 text generated from the FormBuilder module?
 
 When looking at the source of the form in the web browser, it has:
 
 
 ?xml version=1.0 encoding=utf-8?
 !DOCTYPE html
  PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
   http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
 html xmlns=http://www.w3.org/1999/xhtml; lang=de_DE xml:lang=de_DE
 
 head
 titleJobnummer erzeugen/title
 link href=/styles/cgiforms.css rel=stylesheet type=text/css /
 script type=text/javascript!-- hide from old browsers
 [...]
 
 /script
 /head
 body
 h3Jobnummer erzeugen/h3
 noscriptspan class=fb_invalidBitte aktivieren Sie JavaScript oder 
 benutzen Sie einen neueren Webbrowser./span/noscript
 pSie m�ssen Angaben f�r die span 
 class=fb_requiredhervorgehobenen/span Felder machen./p
 [...]
 
 
 So the header says the encoding is UTF-8.  The message template is also 
 UTF-8:
 
 sunflo cgi-bin # file 
 /usr/lib/perl5/vendor_perl/5.20.1/CGI/FormBuilder/Messages/de.pm
 /usr/lib/perl5/vendor_perl/5.20.1/CGI/FormBuilder/Messages/de.pm: Perl5 
 module source, UTF-8 Unicode text
 sunflo cgi-bin #
 
 
 Text with Umlauten I put myself into the form, like field labels, are 
 shown correctly.  I have put '@charset utf-8;' at the beginning of the 
 style sheet, but it doesn't help.
 
 How could I fix this problem?

This is probably not the best list for this question, but one possible 
solution is to html encode it. You can use app-text/recode as follows:

# echo 'ü' | recode utf8...html
uuml;

Or just use the codes from:
http://www.lsa.umich.edu/german/hmr/schreiben/umlaute/umlaute_ASCII_html.html

-- 
Fernando Rodriguez



Re: [gentoo-user] use CGI::FormBuilder::Multi; ...

2015-08-22 Thread hw



Am 21.08.2015 um 21:18 schrieb Fernando Rodriguez:

On Friday, August 21, 2015 12:36:59 PM hw wrote:


Hi,

any idea why Umlaute are not displayed correctly when they appear in
text generated from the FormBuilder module?

When looking at the source of the form in the web browser, it has:


?xml version=1.0 encoding=utf-8?
!DOCTYPE html
  PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
   http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
html xmlns=http://www.w3.org/1999/xhtml; lang=de_DE xml:lang=de_DE

head
titleJobnummer erzeugen/title
link href=/styles/cgiforms.css rel=stylesheet type=text/css /
script type=text/javascript!-- hide from old browsers
[...]

/script
/head
body
h3Jobnummer erzeugen/h3
noscriptspan class=fb_invalidBitte aktivieren Sie JavaScript oder
benutzen Sie einen neueren Webbrowser./span/noscript
pSie m�ssen Angaben f�r die span
class=fb_requiredhervorgehobenen/span Felder machen./p
[...]


So the header says the encoding is UTF-8.  The message template is also
UTF-8:

sunflo cgi-bin # file
/usr/lib/perl5/vendor_perl/5.20.1/CGI/FormBuilder/Messages/de.pm
/usr/lib/perl5/vendor_perl/5.20.1/CGI/FormBuilder/Messages/de.pm: Perl5
module source, UTF-8 Unicode text
sunflo cgi-bin #


Text with Umlauten I put myself into the form, like field labels, are
shown correctly.  I have put '@charset utf-8;' at the beginning of the
style sheet, but it doesn't help.

How could I fix this problem?


This is probably not the best list for this question, but one possible


Likely not, yet it could be a Gentoo-specific problem.


solution is to html encode it. You can use app-text/recode as follows:

# echo 'ü' | recode utf8...html
uuml;

Or just use the codes from:
http://www.lsa.umich.edu/german/hmr/schreiben/umlaute/umlaute_ASCII_html.html


Thanks, I could patch the message template accordingly, that would solve 
the problem :)




[gentoo-user] Any 'sed' geniuses out there?

2005-09-26 Thread gentuxx
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I'm writing a sed script that will parse the *broken* output of
man2html. I say broken, because the output isn't W3C compliant (html
OR xhtml). I'd like to be able to modify it so that the final outcome
is XHTML 1.0 compliant. I'm running into a problem where the output
doesn't close the p, dt, or dd tags. XHTML requires that tags
containing text be closed. So the problem I'm having is being able to
take note of the starting tag, grab the subsequent paragraph, then
insert the closing tag. What I've got /sort of/ works, but still not.

Here's a sample that has been parsed, but not with the p modifying
elements:

p

Regular expression support is provided by the PCRE library package,
which is open source software, written by Philip Hazel, and copyright
by the University of Cambridge, England.  See a
href=http://www.pcre.org/;http://www.pcre.org//a .

p

Nmap can optionally link to the OpenSSL cryptography toolkit, which is
available from a
href=http://www.openssl.org/;http://www.openssl.org//a .


Here's the entire sedscr (sans comments):

/^$/{
N
/^\n$/d
}
/^Content-type: text\/html/c\
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
s%\(HTML\|P\|HEAD\|TITLE\|BODY\|STRONG\|EM\|H[123456]\|D[DLT]\|T[TDRH]\)%\L\1%g
s%\/\(HTML\|P\|A\|HEAD\|TITLE\|BODY\|STRONG\|EM\|H[123456]\|D[DLT]\|T[TDRH]\)%\L/\1%g
s%BR%br /%g
s%HR%hr /%g
s%[Dd][Ll] [Cc][Oo][Mm][Pp][Aa][Cc][Tt]%dl compact=compact%
s%A HREF\(.*\)%a href\1%g
s%A NAME\(.*\)%a name\1%g
/^[IB].*$/{
N
s%\([IB]\)\(.*\)\(\/[IB]\)\n%\L\1\2\L\3%
}
/^[ib].*$/{
N
s%\n%%
}
s%[IB]%\L%
s%\/[IB]%\L%
/body/,/\/body/{
/p/!{
H
d
}
/p/{
x
s/$/\/p/
G
}
}
/^p$/,/\p$/{
N
/^\np$/d
}


Here's the funkiness after parsing with the last part
(/body/,/\/body/{) enabled:

p

p

Regular expression support is provided by the PCRE library package,
which is open source software, written by Philip Hazel, and copyright
by the University of Cambridge, England.  See a
href=http://www.pcre.org/;http://www.pcre.org//a ./p

p

p

Nmap can optionally link to the OpenSSL cryptography toolkit, which is
available from a
href=http://www.openssl.org/;http://www.openssl.org//a ./p



(Just in case you were wondering, this IS from the nmap man page. ;-)
Thanks.

- --
gentux
echo hfouvyAdpy/ofu | perl -pe 's/(.)/chr(ord($1)-1)/ge'

gentux's gpg fingerprint == 34CE 2E97 40C7 EF6E EC40  9795 2D81 924A
6996 0993
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDOMBkLYGSSmmWCZMRAnnrAJwKNqr+/OgBdDD8X8PXX6rpKUfaxQCfU9PW
Bs2oA/76RYFbbc7DWEpfTM8=
=gcc/
-END PGP SIGNATURE-

-- 
gentoo-user@gentoo.org mailing list