php-i18n Digest 9 Sep 2002 11:30:42 -0000 Issue 123

Topics (messages 316 through 319):

Re: Japanese/mbstring: mb_detect_encoding differnet in IE5 and N7
        316 by: Rui Hirokawa

Re: Japanese: multiple internal encodings possible?
        317 by: Rui Hirokawa

ISO to EUC convertion
        318 by: prabahar

gettext
        319 by: Marco Muratori

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---

If string is too short, encoding detection of mbstring might be failed,
because code map of the different character encodings are overlapped.
A typical solution to detect user input encoding is 
to use hidden input tag in the same form having longer multibyte string.


On Tue, 03 Sep 2002 19:08:03 +0900
[EMAIL PROTECTED] (Jean-Christian Imbeault) wrote:

> I don't know if this is a problem with PHP or with the browsers but I am 
> observing different output of my PHP script depending whether I am using 
> IE5.5-japanese or N7-english.
> 
> The script is:
> 
> echo "Current encoding is: ".mb_http_output()."<BR>";
> echo "Current encoding is: ".mb_get_info("all")."<BR>";
> echo "The encoding of name is ".mb_detect_encoding($_POST["name"])."<BR>";
> mb_http_output("EUC-JP");
> 
> 
> The output for IE5.5 is:
> 
> Current encoding is: pass
> Current encoding is: Array
> The encoding of name is EUC-JP
> 
> The output for N7 is:
> 
> Current encoding is: pass
> Current encoding is: Array
> The encoding of name is ASCII
> 
> I called this script from a form where I entered one single kanji (ai, 
> love) in POST var name.
> 
> When entered from Netscape PHP recognize the input as ASCII when it 
> should have been SJIS!
> 
> Why? How can I fix it?
> 
> Thanks,
> 
> Jc
> 
> PS The form was generated by PHP and I set the charset as follows:
> 
> <head
>    <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
> </head>
> 
> Also my settings for mbstring were:
> 
> Multibyte (Japanese) Support enabled
> http input encoding translation enabled
> 
> mbstring.detect_order: auto
> mbstring.func_overload: 0
> mbstring.http_input: auto
> mbstring.http_output: SJIS
> mbstring.internal_encoding: EUC-JP
> mbstring.substitute_character: no value
> 


-- 
-----------------------------------------------------
Rui Hirokawa <[EMAIL PROTECTED]>
             <[EMAIL PROTECTED]>
--- End Message ---
--- Begin Message ---

PHP 4.3.0 will support conversion from script encoding 
to internal encoding.

This option is enable if --enable-zend-multibyte is set with configure.

You can specify the script encoding in php.ini,

mbstring.script_encoding = SJIS
mbstring.internal_encoding = EUC-JP

If you want to use now, please try snapshot (snaps.php.net)
or cvs.

On Wed, 21 Aug 2002 18:41:19 +0900
[EMAIL PROTECTED] (Jean-Christian Imbeault) wrote:

> I am currently writting PHP scripts that accesses a database containing 
> data in EUC-JP. However the web page designers are wrting there pages in 
> SJIS.
> 
> I'm finding that my pages don't display well because the data I get back 
> is in EUC-JP and the hard-coded text the designers put in is in SJIS. Is 
> there any easy solution around this (besides the obvious of doing an 
> mb_convert_encoding() on all my variables.)
> 
> Thanks,
> 
> Jc
> 


-- 
-----------------------------------------------------
Rui Hirokawa <[EMAIL PROTECTED]>
             <[EMAIL PROTECTED]>
--- End Message ---
--- Begin Message ---
Hi, 
I have requirement like this... Read a TEXT file that has codes that 
represents Japanese chars in iso-8859-1 encoding. 
example "&#35336;&#30011;&#23550;&#27604;" I have to read these and convert 
into EUC and write the EUC to a different file.

"
<?php

$fpI = fopen("E:\\input.txt","r");
$fpO = fopen("E:\\output.txt","w+");
$row=0;

while ($data = fgetcsv ($fpI, 1000, "=")) {
    $num = count ($data);
    $row++;

    $str=mb_convert_encoding ( $data[0], "EUC-JP", "ASCII") . "\n";
    fputs($fpO, $str);
}
?>

"

But this doesnt work. Can u please guide me how to achieve this.

Thankyou in advance,
Prabahar
_____________________________________________________________________
Any Opinions, explicit or implied, are solely those of the author and do not 
necessarily
represent those of Questech. This e-mail may contain confidential and/or privileged
information. If you are not the intended recipient (or have received this e-mail in 
error)
please notify the sender immediately and destroy this e-mail. Any unauthorized copying,
disclosure or distribution of the material in this e-mail is strictly forbidden.
_____________________________________________________________________


--- End Message ---
--- Begin Message ---
Hi,
I'm using gettext to add i18n to a website. As "msgid" for the single
messages, I'm not using the original text to be translated, but a shorter
string that have no relation with the actual text.
For example, if the text to be translated is "Hello world" I write
"print(gettext("HW"))" in PHP and put

#: hello.php 2
msgid "HW"
msgstr "Hello world"

in the ".po" file. This way, if necessary, "HW" will be diplayed as
default string, which of course is not good. What could be in this case the
best way to manage default strings?
Thanks

--- End Message ---

Reply via email to