php-i18n Digest 16 Jan 2003 12:53:10 -0000 Issue 143

Topics (messages 409 through 415):

Re: imap_utf7_[en|de]code, from/to which charset?
        409 by: Moriyoshi Koizumi
        410 by: Jan Schneider
        411 by: Moriyoshi Koizumi
        412 by: Jan Schneider
        413 by: Moriyoshi Koizumi

Content-Length: and multibyte
        414 by: Jan Schneider

algorithm possibility for php /mysql
        415 by: bda

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 ---
On Sun, Jan 12, 2003 at 06:37:48PM +0100, Jan Schneider wrote:
> The PHP manual is a bit vague on what the imap_utf7 methods 
> expect/return: "Converts 8bit data to modified UTF-7 text."
> 
> 8bit data in what encoding? iso-8859-1 I guess.

imap_utf7_encode() function appears to regard any input strings as
encoded in iso-8859-1 just like utf8_encode(). And vice versa.

I'll be happy as a developer of php internals if you report such vagueness
at the bug database too.
 
> Does the modified utf-7 charset exist as such on common systems so that 
> I can use mb_convert_encoding() or iconv() instead? If so, what's its name?

As php's iconv extension is a mere wrapper of the iconv library and
imap utf-7 support is lacking in most iconv implementations,
it's generally better to use mb_convert_encoding() than iconv().

Try the following: 
mb_convert_encoding("blahblah", "utf7-imap", "iso-8859-15");

Moriyoshi
--- End Message ---
--- Begin Message ---
Moriyoshi Koizumi wrote:
On Sun, Jan 12, 2003 at 06:37:48PM +0100, Jan Schneider wrote:

The PHP manual is a bit vague on what the imap_utf7 methods expect/return: "Converts 8bit data to modified UTF-7 text."

8bit data in what encoding? iso-8859-1 I guess.

imap_utf7_encode() function appears to regard any input strings as
encoded in iso-8859-1 just like utf8_encode(). And vice versa.

I'll be happy as a developer of php internals if you report such vagueness
at the bug database too.
Done.

Does the modified utf-7 charset exist as such on common systems so that I can use mb_convert_encoding() or iconv() instead? If so, what's its name?

As php's iconv extension is a mere wrapper of the iconv library and
imap utf-7 support is lacking in most iconv implementations,
it's generally better to use mb_convert_encoding() than iconv().

Try the following: mb_convert_encoding("blahblah", "utf7-imap", "iso-8859-15");
That's not quite an answer to my question but thanks anyway. ;-)
Just to clarify: utf7-imap is an official or at least supported charset name?

Jan.

--- End Message ---
--- Begin Message ---
On Sun, Jan 12, 2003 at 11:40:30PM +0100, Jan Schneider wrote:
> >I'll be happy as a developer of php internals if you report such vagueness
> >at the bug database too.
> 
> Done.

Thanks.
 
> That's not quite an answer to my question but thanks anyway. ;-)
> Just to clarify: utf7-imap is an official or at least supported charset 
> name?

Although I still wonder if this is the exact answer to your question,
IMAP version of utf-7 is defined in RFC2060 but there's no entry for it
in IANA charset registry.

Moriyoshi
--- End Message ---
--- Begin Message ---
Moriyoshi Koizumi wrote:
That's not quite an answer to my question but thanks anyway. ;-)
Just to clarify: utf7-imap is an official or at least supported charset name?

Although I still wonder if this is the exact answer to your question,
IMAP version of utf-7 is defined in RFC2060 but there's no entry for it
in IANA charset registry.
That's exactly the answer. So I assume that the mbstring extension has the modified utf-7 charset encoding as defined in rfc 2060 internally implemented?

Jan.

--- End Message ---
--- Begin Message ---
On Mon, Jan 13, 2003 at 12:11:15AM +0100, Jan Schneider wrote:
> >Although I still wonder if this is the exact answer to your question,
> >IMAP version of utf-7 is defined in RFC2060 but there's no entry for it
> >in IANA charset registry.
> 
> That's exactly the answer. So I assume that the mbstring extension has 
> the modified utf-7 charset encoding as defined in rfc 2060 internally 
> implemented?

Yep. mbstring extension makes use of a bundled library named "mbfilter",
and doesn't rely on any external libraries.

Moriyoshi
--- End Message ---
--- Begin Message --- OK, this is not really PHP related but I thought I might ask anway:
If sending the Content-Length: http header to the browser for a page that's encoded in a multibyte charset, do I use the binary length or the character length?

Jan.

--- End Message ---
--- Begin Message ---
I have an issue that I am trying to solve.  I can script this problem using
fixed length arrays, but I am seeking a more simplified and elegant
solution.  At the heart of the problem is dealing with variable length
arrays and comparison.

In essence this is the problem.  If a table row record
(master_times) contains all possible dates and times for an event, a
seperate table row record (response_times) will containt all dates and times
that an individual is availalbe for that event, based on the date and times
allowed as specified in master_times.  This data is exploded to populate an
array with User as key, and all values of that key being date/time.

Now, how can I determine, in a case where x users have replied with y times
where one or more times(z) exisists in all occurances of user(x)?  Or, if
none exists, the closest match?  See grid below.  This doing it by a fixed
length array where summing is used, but I hope that there is a better way.

         | Monday  0800 | Monday  0900 |Thursday 1000
John  |       True           |       False          |    False
Jane  |        False         |        True          |     True
Mike |        True          |        False         |     False

In this case, Monday at 0800 would be best, even though it is not all true.
So ouput should be John and Mike on Monday at 0800.  Again, consider that
this must scale as times could be as large as 200 records and Users could
push 100.  So I beleieve that just running fixed lenth arrays is kind of
inefficient.  Ideas
anyone?




--- End Message ---

Reply via email to