[Koha-devel] Re: Koha & UNICODE

Ambrose LI <acli@ada.dhs.org> via forwarder news-misc at ada.dhs.org
Tue Oct 19 19:34:01 CEST 2004


In article <416B90AD.2040402 at free.fr>,
Paul POULAIN <paul.poulain at free.fr> wrote:
>
>Does anyone have an opinion on this ? Do we have to use utf16 or is utf8
>possible ?

certainly UTF8. UTF16 would be very unnatural and (for most Unices)
very difficult to work with.

>For me, it means :
>* rewrite all templates in utf
>* parse all perl scripts for unicode support (what does it means exactly
>? i'm not sure. chapter 15 of Perl Programming is not enough for me)
>* dump non utf DB & reload it in utf (specifis pragmas in mySQL)
>* other things ?

In article <200410121414.i9CEEd1x032673 at alma.athenscounty.lib.oh.us>,
Owen Leonard <oleonard at athenscounty.lib.oh.us> wrote:
>> > * rewrite all templates in utf
>> 
>> This much is straightforward: iconv could do much of the 
>> legwork, as could html tidy.
>
>What would specifically be involved in rewriting the 
>templates?
> -- changing the encoding in the document head (adding an xml 
>prologue would be the most correct way of doing this, but this 
>causes display problems in Internet Explorer.  The recommended 
>method at present is to use <meta http-equiv="Content-
>Type"...>)

Just run the templates through iconv and modify the .inc files
to have a <meta http-equiv="Content-Type"...> header. (You can
look at either the Polish or Chinese templates in Koha 2.0 as
a reference; both of them are UTF-8.)

If you just add a meta tag, both the meta tag and the HTTP
header should contain the correct charset information. (If this
is not the case, then the CGI script that generates the HTML
from the template has a bug and will need to be fixed.)

> -- altering the encoding of some characters in the templates? 
> I wonder if this affects the English templates?

iconv should be able to handle this easily; in case it fails
somewhere, there are other converters that have better error
handling :-)

>What else?
>
>If you were using tidy to clean up templates, you'd have to 
>configure it to only alter the character encoding, and not 
>touch the document structure, right?  

I think HTML tidy would be overkill, and it will probably become
confused by the templating directives.

-- 
Ambrose LI Cheuk-Wing  <a.c.li at ieee.org>

http://ada.dhs.org/~acli/




More information about the Koha-devel mailing list