Skip to main content.
home | support | download

Back to List Archive

Re: Once again filename encoding problems - Macos-X Tiger

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Mon Nov 14 2005 - 12:49:15 GMT
On Mon, Nov 14, 2005 at 01:32:01AM -0800, Thomas Nyman wrote:
> For instance the file AKTIEÄGARAVTAL.doc  doesnt dispplay properly  
> in the browser. It says AKTIEAÌ^GARAVTAL.doc , howvere when i move  
> the cursor over the filename it shows the pathy with the correct  
> disppay.
> 
> /swish.cgi | head    give the following result
> 
>      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
> 
> the browser default encoding is UTF-8
> 
> my terminal can display the characters correctly.
> It only in the webbrowser when doing a swish-e search som they  
> display improperly.

I assume it's a problem of encodings.

Swish indexex as 8859-1 encoding.  So when you print results the
results are encoded in 8859-1.  But if you tell the web client/browser
that the results are in utf-8 then any character values that don't map
exactly to the utf-8 char set from 8859-1 (any eight bit chars) then
they won't display correctly.

If you want to display results using utf-8 then you probably need to
use iconv to convert the results to utf-8.

Here's the iconv perl module:

    http://search.cpan.org/~mpiotr/Text-Iconv-1.4/Iconv.pm

Or just change your http header:

    Content-Type: text/html; charset=ISO-8859-1

Of if you don't have control over the http headers:

    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />



-- 
Bill Moseley
moseley@hank.org

Unsubscribe from or help with the swish-e list: 
   http://swish-e.org/Discussion/

Help with Swish-e:
   http://swish-e.org/current/docs
   swish-e@sunsite.berkeley.edu
Received on Mon Nov 14 04:49:31 2005