On Fri, May 04, 2001 at 08:34:40AM +0200, Andre Poenitz wrote:
> Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
> Precedence: bulk
> X-No-Archive: yes
> List-Post: <mailto:[EMAIL PROTECTED]>
> List-Help: <mailto:[EMAIL PROTECTED]>
> List-Unsubscribe: <mailto:[EMAIL PROTECTED]>
> Delivered-To: mailing list [EMAIL PROTECTED]
> From: Andre Poenitz <[EMAIL PROTECTED]>
> Subject: Re: Unicode (was Re: enormous)
> In-Reply-To: <[EMAIL PROTECTED]> from John Weiss at "May 2, 2001
>  08:02:45 pm"
> To: John Weiss <[EMAIL PROTECTED]>
> Date: Fri, 4 May 2001 08:34:40 +0200 (CEST)
> CC: LyX devel <[EMAIL PROTECTED]>
> X-Mailer: ELM [version 2.4ME+ PL60 (25)]
> 
> > Actually, you'd just store it internally as a sequence of "char".
> > Nothing complicated there.
> 
> It is pretty complicated. Just tell me in O(1) time at what physical
> offset the n-th "logical" character sits.
> 
> I fear you have to scan the whole sequence...

If you actually want that number n, yes. No way around it.

On the other hand one could ask, is there any legitimate use for this 
operation in a word processor? What I remember (I have coded WPs in a 
previous life) the most common operation was traversing a string 
sequentially, either from the start or from the current cursor. Not 
even moving the cursor vertically up or down can be done with direct 
access, if the font used is proportional.
 
> UTF-8 is only appropriate for sequential, not for random access. UTF-8 in
> files is fine, but not internally.

A compromise solution would be to internally, and transparently,
convert a "block" of text from UTF-8 to 32 bits representation and back.

The size of the block? Uhhh... what about the whole loaded document? :-)
We have the include facility.

> Andre'
> 
> 
> -- 
> André Pönitz ............................................. [EMAIL PROTECTED]
> 

Martin
-- 
Martin Vermeer  [EMAIL PROTECTED]
Helsinki University of Technology 
Department of Surveying
P.O. Box 1200, FIN-02015 HUT, Finland
:wq

Reply via email to