logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: char set encoding
Author
chuck1rar



Joined: 07 Feb 2006
Posts: 13

PostPosted: Tue 07 Feb '06 16:57    Post subject: char set encoding Reply with quote

Am running apache 2.5 on windows 2003 machine with CF MX7.
Have not changed the default settings for char set encoding.
Have 2 websites that are encoded using for english char sets and another website that must display Japanese SJIS.

Problem seems to be on apache.
Have tested the CF app server and when I run CF locally using inbuilt web server then all is fine.
But on the production server with apache my pages are not displayed accordingly. Not a browser issue as I will swap the encoding to sjis but it all comes out garbled...also my pages use sjis in the page encoding and it also works in development mode.

So after resonable deduction must be something with apache..
But the default settings already have sjis as a char set and also ja as a language...

What should I be looking at???
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Tue 07 Feb '06 17:40    Post subject: Reply with quote

Do you use <meta tag in the html pages with the charset?

for default carset see

http://httpd.apache.org/docs/2.2/mod/core.html#adddefaultcharset

I would use utf-8

Also see
http://httpd.apache.org/docs/2.2/mod/mod_negotiation.html
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Wed 08 Feb '06 11:38    Post subject: Reply with quote

If you work with PHP I found another solution
Code:

<?php
$charsets = array(       
'iso-8859-1', // default       
'iso-8859-2',       
'iso-8859-15',     
'utf-8');
$pref = http_negotiate_charset($charsets, $result);
if (strcmp($pref, 'iso-8859-1')) {       
 iconv_set_encoding('internal_encoding', 'iso-8859-1'); 
 iconv_set_encoding('output_encoding', $pref);       
ob_start('ob_iconv_handler');
}
print_r($result);?>
Back to top
chuck1rar



Joined: 07 Feb 2006
Posts: 13

PostPosted: Wed 08 Feb '06 11:58    Post subject: language Reply with quote

Found the problem..
I needed to add <html langauage ja> to each page..
I thought by just having the char set was enough but obviously not.

Thanks
Back to top


Reply to topic   Topic: char set encoding View previous topic :: View next topic
Post new topic   Forum Index -> Apache