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 not changed. You

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 some substitution character; you

When to validate?

2004-12-10 Thread Arcane Jill
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, now suppose I write a second

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 input,

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

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

Re: When to validate?

2004-12-10 Thread Mark Davis
Subject: When to validate? 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

Re: When to validate?

2004-12-10 Thread Doug Ewell
Arcane Jill arcanejill at ramonsky dot com 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

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 validation.