[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bricolage-general
Subject:    Re: Fixing MS Word smart quotes/character encoding
From:       "David E. Wheeler" <david () kineticode ! com>
Date:       2008-02-28 23:34:27
Message-ID: 7BAA2A79-0409-454D-9D98-6D55136888BD () kineticode ! com
[Download RAW message or body]

On Feb 22, 2008, at 13:38, Jason Brackins wrote:

> We ended up going with this method. But I never got code from
> demoriniser to work. The regex codes didn't seem to match the smart
> quotes that word was putting out.
>
> What did work for us to just copy smart quotes from word directly into
> our filter regexes. We don't need the full gamut of demorinser  
> features,
> so our filter looks like this (at the top of /autohandler.mc).
>
> <%filter>
>   s/['']/'/g;
>   s/[""]/"/g;
>   s/.../.../g;
>   s/-/&ndash;/g;
>   s/-/&mdsash;/g;
> </%filter>
>
> (I hope those characters come through. It may look messed up in some
> email clients. (exactly the problem we're trying to solve))

Encode::ZapCP1252 does the same thing, as Marshall said. Put this in  
your bricolage.conf:

PERL_LOADER=use Encode::ZapCP1252;

Then this would be your template:

<%filter>
$_ = zap_cp1252($_);
</%filter>

Best,

David
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic