Erik schreef:

> I just figured out a way to get a result that is correctly displayed
> in the browser and does not give error messages from code2html!
>
> Here is what I had to do:
> 1. Add "use locale;" to code2html.
> 2. Make sure that LANG is set to swedish (I executed "export
> LANG=swedish" in the shell. To make it permanent in Gentoo I added
> "LANG=swedish" to /etc/env.d/02locale and executed env-update.)
> 3. Execute "code2html prov.adb prov.adb.html".

Yes, that looks like a nice and clean solution.


> Here is what I had to avoid doing:
> * Add "use encoding 'latin1';" to code2html. With this, code2html
> still
> seems to produce correct output, but it shows error messages on the
> konsole ("Malformed UTF-8 character ...").

OK. I hope you got it that the "use encoding ..." is only about the
encoding of the script, not of the input. See `perldoc encoding` for
details.


> * Converting the file with iconv first. This will produce "<font
> color="#2040a0">AÃ</font>¥<font color="#2040a0">l</font>".

Yes, that is quite a strange split.


> It works for me now, but it would be preferrable if code2html would
> always behave as if LANG was set to swedish, so it will just work for
> everyone everywhere.

Maybe code2html just needs an option that activates "use locale;".


> Yes, it should include <meta http-equiv="Content-Type"
> content="text/html; charset=ISO-8859-1"> in the <head>.

Did you try the "-c"?


>           'regex'      => '\\b[[:alpha:]](?:_?[^\W_])*\\b', 'style'

Maybe you should change the [^\W_] to [[:alnum:]], for readability.
I still prefer a "+" directly behind it, mainly because I see a "_" as a
separator betweeb groups of alnums.

-- 
Affijn, Ruud

"Gewoon is een tijger."



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to