Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] OT-Japanese in PHP



Mark Sargent wrote:
> Erin D. Hughes via info@example.com wrote:
> 
>> Mark Sargent wrote:
>>
>>> Hi All,
>>>
>>> ok, I recompiled php to support J. Below are my settings,
>>>
>>> output_handler = mb_output_handler
>>> mbstring.language = Japanese
>>> mbstring.internal_encoding = UTF-8
>>> mbstring.http_input = auto
>>> mbstring.http_output = SJIS
>>> mbstring.encoding_translation = On
>>> mbstring.detect_order = auto
>>> mbstring.substitute_character = none
>>> mbstring.internal_encoding = EUC-JP
>>>
>>> Now, I think I still haven't got the page that requires J, displayed 
>>> right, yet. Full code is below. Can anyone see any mistakes..? Cheers.
>>
>>
>>
>> Look in your httpd.conf for something like.
>> #AddDefaultCharset UTF-8
>> AddDefaultCharset shift_jis
>> AddDefaultCharset EUC
>>
>> If you comment out UTF-8 you should get your charset=Shift-JIS to 
>> display correctly.
>>
>> I beleive and some one else can correct me if I am wrong that your 
>> settings in httpd.conf override the mb-string just as they override 
>> the page settings..... also I do not believe you need mbstring to 
>> display Japanese text in php..... could be wrong here as well but I 
>> had one server with custom compiled php and no mb-string and it 
>> displayed the text fine. However when you tried to use special 
>> functions in PHP that called mb-string like formating mail subject 
>> lines it would not work.
>>
>> Please re-inform me if you are wrong.
>>
>>
>> E./
>>
>>
>>
> thanx, Erin, but, there was no instance of AddDefaultCharset for 
> anything in httpd.conf, only AddCharset  "value" for a number of 
> languages. 
Wait that is it comment out UTF-8 it should work then look at my example
utf-8 is commented out.
 >> #AddDefaultCharset UTF-8
 >> AddDefaultCharset shift_jis
 >> AddDefaultCharset EUC

I added  AddDefaultCharset shift_jis and uncommented both
> instances of AddCharset UTF-8 and restarted the server, but, still no 
> luck with it. It's got to be something simple..? Cheers.
> 
> Mark Sargent.
> 
>>>
>>> Mark Sargent.
>>>
>>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
>>> <html>
>>> <head>
>>>    <meta http-equiv="Content-Type" content="text/html; 
>>> charset=Shift-JIS" />
>>> <title>Jumbo Status-Product Details</title>
>>> </head>
>>> <body lang="ja">
>>> <hr>
>>> <h1 align="center">JUMBO STATUS</h1><p>
>>> <center>Used Hardware Specialist</center>
>>> <center><a href="index.php">Home</a></center>     <center><a 
>>> href="search.php">Search</a></center>
>>> <hr>
>>> <table align="center" bgcolor="lightblue" cellpadding="2" border="2" 
>>> width="60%">
>>> <?php
>>> $db = mysql_connect("localhost", "????", "?????");
>>> if (!$db) {
>>>  echo "no connection because " . mysql_error();
>>>  exit;
>>> }
>>> mysql_select_db("status", $db);
>>> if (isset($_REQUEST[product_id])) {
>>>   $product_id = $_REQUEST[product_id];
>>> $result = mysql_query("SELECT Products.product_id, 
>>> Products.product_name, Products.product_model_number, 
>>> Products.product_price, Products.product_qty, Products.product_desc, 
>>> Products.product_data_output, Conditions.condition_detail FROM 
>>> Products INNER JOIN Conditions On Products.condition_id = 
>>> Conditions.condition_id WHERE Products.product_id = '$product_id'");
>>> if (!$result) {
>>>    echo "Query failed: " . mysql_error();
>>>  exit;
>>> }
>>> $num = mysql_num_rows($result);
>>> $rows = mysql_fetch_array($result);
>>> echo "<tr align=¥"center¥"><td colspan=¥"4¥">Status-Product 
>>> Details</td></tr>";
>>> }
>>> for ($i=0; $i<$num; $i++){
>>> echo "<tr align=¥"center¥"><td>PRODUCT 
>>> NAME</td><td>".$rows['product_name']."</td><br><tr 
>>> align=¥"center¥"><td>QUANTITY</td><td>".$rows['product_qty']."</td></tr><br><tr 
>>> align=¥"center¥"><td>PRICE</td><td>".$rows['product_price 
>>> yen']."</td></tr><br><tr 
>>> align=¥"center¥"><td>CONDITION</td><td>".$rows['product_condition']."</td></tr><tr 
>>> align=¥"center¥"><td colspan=¥"2¥">MORE DETAILS</td></tr><tr 
>>> align=¥"center¥"><td 
>>> colspan=¥"2¥">".$rows['product_desc']."</td></tr><tr 
>>> align=¥"center¥"><td colspan=¥"2¥">DATA OUTPUT</td></tr><tr 
>>> align=¥"center¥"><td  colspan=¥"2¥"><font 
>>> type=¥"Shift_JIS¥">".$rows['product_data_output']."</font></td></tr>";
>>> }
>>> ?>
>>> </table>
>>> <p>
>>> <p>
>>> <p>
>>> <hr><center>email: status1@???????<p>
>>> Telephone: ???????<p>
>>> Fax: ????????
>>> </center>
>>> </body>
>>> </html>
>>>
>>
> 


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links