Mailing List Archive

cached encoding (Re: Internationalization Toolkit)
Guido van Rossum <guido@CNRI.Reston.VA.US> wrote:
> One specific question: in you discussion of typed strings, I'm not
> sure why you couldn't convert everything to Unicode and be done with
> it. I have a feeling that the answer is somewhere in your case study
> -- maybe you can elaborate?

Marc-Andre writes:

Unicode objects should have a pointer to a cached (read-only) char
buffer <defencbuf> holding the object's value using the current
<default encoding>. This is needed for performance and internal
parsing (see below) reasons. The buffer is filled when the first
conversion request to the <default encoding> is issued on the object.

keeping track of an external encoding is better left
for the application programmers -- I'm pretty sure that
different application builders will want to handle this
in radically different ways, depending on their environ-
ment, underlying user interface toolkit, etc.

besides, this is how Tcl would have done it. Python's
not Tcl, and I think you need *very* good arguments
for moving in that direction.

</F>
Re: cached encoding (Re: Internationalization Toolkit) [ In reply to ]
Fredrik Lundh wrote:
>
> Guido van Rossum <guido@CNRI.Reston.VA.US> wrote:
> > One specific question: in you discussion of typed strings, I'm not
> > sure why you couldn't convert everything to Unicode and be done with
> > it. I have a feeling that the answer is somewhere in your case study
> > -- maybe you can elaborate?
>
> Marc-Andre writes:
>
> Unicode objects should have a pointer to a cached (read-only) char
> buffer <defencbuf> holding the object's value using the current
> <default encoding>. This is needed for performance and internal
> parsing (see below) reasons. The buffer is filled when the first
> conversion request to the <default encoding> is issued on the object.
>
> keeping track of an external encoding is better left
> for the application programmers -- I'm pretty sure that
> different application builders will want to handle this
> in radically different ways, depending on their environ-
> ment, underlying user interface toolkit, etc.

It's not that hard to implement. All you have to do is check
whether the current encoding in <defencbuf> still is the same
as the threads view of <default encoding>. The <defencbuf>
buffer is needed to implement "s" et al. argument parsing
anyways.

> besides, this is how Tcl would have done it. Python's
> not Tcl, and I think you need *very* good arguments
> for moving in that direction.
>
> </F>
>
> _______________________________________________
> Python-Dev maillist - Python-Dev@python.org
> http://www.python.org/mailman/listinfo/python-dev

--
Marc-Andre Lemburg
______________________________________________________________________
Y2000: 51 days left
Business: http://www.lemburg.com/
Python Pages: http://www.lemburg.com/python/
Re: cached encoding (Re: Internationalization Toolkit) [ In reply to ]
Just a couple observations from the peanut gallery...

1. I'm glad I don't have to do this Unicode/UTF/internationalization stuff.
Seems like it would be easier to just get the whole world speaking
Esperanto.

2. Are there plans for an internationalization session at IPC8? Perhaps a
few key players could be locked into a room for a couple days, to emerge
bloodied, but with an implementation in-hand...

Skip Montanaro | http://www.mojam.com/
skip@mojam.com | http://www.musi-cal.com/
847-971-7098 | Python: Programming the way Guido indented...
Re: cached encoding (Re: Internationalization Toolkit) [ In reply to ]
>>>>> "SM" == Skip Montanaro <skip@mojam.com> writes:

SM> 2. Are there plans for an internationalization session at
SM> IPC8? Perhaps a few key players could be locked into a room
SM> for a couple days, to emerge bloodied, but with an
SM> implementation in-hand...

I'm starting to think about devday topics. Sounds like an I18n
session would be very useful. Champions?

-Barry
Re: cached encoding (Re: Internationalization Toolkit) [ In reply to ]
> 2. Are there plans for an internationalization
> session at IPC8? Perhaps a
> few key players could be locked into a room for a
> couple days, to emerge
> bloodied, but with an implementation in-hand...

Excellent idea.

- Andy


=====
Andy Robinson
Robinson Analytics Ltd.
------------------
My opinions are the official policy of Robinson Analytics Ltd.
They just vary from day to day.

__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com
Re: cached encoding (Re: Internationalization Toolkit) [ In reply to ]
--- "Barry A. Warsaw" <bwarsaw@cnri.reston.va.us>
wrote:
>
> I'm starting to think about devday topics. Sounds
> like an I18n
> session would be very useful. Champions?
>
I'm willing to explain what the fuss is about to
bemused onlookers and give some examples of problems
it should be able to solve - plenty of good slides and
screen shots. I'll stay well away from the C
implementation issues.

Regards,

Andy

=====
Andy Robinson
Robinson Analytics Ltd.
------------------
My opinions are the official policy of Robinson Analytics Ltd.
They just vary from day to day.

__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com