Re: When to validate?

2004-12-13 Thread Arcane Jill
I like that. Makes total sense. Thanks. Jill -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Antoine Leca Sent: 10 December 2004 17:38 To: Unicode Subject: Re: When to validate? As a result, your strings are likely to be some stuctures. Then, it is pretty

RE: When to validate?

2004-12-11 Thread Lars Kristan
Title: RE: When to validate? Antoine Leca wrote: > As a result, your strings are likely to be some stuctures. > Then, it is pretty easy to add some s_valid flag, and you are done. Is that a proven technique? I'd say not. The flag would only be valid for as long as the string is

RE: When to validate?

2004-12-11 Thread Lars Kristan
Title: RE: When to validate? Andy Heninger wrote: > > Some important things in designing a function API are > > o   Fully define what the behavior is.  With a function like >  tolower(), you could leave malformed sequences unaltered; >  you could replace them with

Re: When to validate?

2004-12-10 Thread Antoine Leca
Arcane Jill va escriure: > And yet, in an expression such as tolower(trim(s)), the second > validation is unnecessary. The input to tolower() /must/ be valid, > because it is the output of trim(). But on the other hand, tolower() > could be called with arbitrary input, so I can't skip the validati

Re: When to validate?

2004-12-10 Thread Doug Ewell
Arcane Jill wrote: > Here's something that's been bothering me. Suppose I write a function > - let's call it trim(), which removes leading and trailing spaces from > a string, represented as one of the UTFs. If I've understood this > correctly, I'm supposed to validate the input, yes? > > Okay, n

Re: When to validate?

2004-12-10 Thread Andy Heninger
Arcane Jill wrote: Here's something that's been bothering me. Suppose I write a function - [ that process strings in one of the UTFs] > I'm supposed to validate the input, yes? You are designing the API - you get to choose what it does. An application as a whole needs to validate external input t

RE: When to validate?

2004-12-10 Thread Carl W. Brown
Jill, I think that the best practice is to validate input. Besides the overhead of revalidating there is the issue of what do you do with data that contains invalid characters. This has to be handles explicitly. Once validated all transforms should maintain valid data. If you also provide a mo

Re: When to validate?

2004-12-10 Thread Mark Davis
Use of the Unicode standard does *not* require constant validation of strings. The standard carefully distinguishes between Unicode strings (D29a-d, page 74) and UTFs. The Unicode strings are in-memory representations of Unicode, but do not have to be valid UTFs; so all Unicode X-bit strings are va

Re: When to validate?

2004-12-10 Thread Marcin 'Qrczak' Kowalczyk
"Arcane Jill" <[EMAIL PROTECTED]> writes: > Here's something that's been bothering me. Suppose I write a function > - > let's call it trim(), which removes leading and trailing spaces from a > string, represented as one of the UTFs. If I've understood this > correctly, I'm supposed to validate the