Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] Do you whitelist or blacklist utf-8?
- Date: Wed, 23 Feb 2011 12:02:32 +0100
- From: Peter Brandt <me387511@example.com>
- Subject: Re: [tlug] Do you whitelist or blacklist utf-8?
- References: <4D639689.1010302@example.com> <4D63EFBC.1020900@example.com>
- User-agent: Thunderbird 2.0.0.0 (Macintosh/20070326)
Hello Shmuel Fomberg wrote:after it is in the target encoding, you probably want to examine only characters that are in the ascii range. if your encoding is utf-8, you can write a tight loop that examine the MSBof a byte, and pass this byte if it is set. else - whitelist / blacklist this byte.> On 2011/02/22 12:57, Dave M G wrote: >> The thing is that I also want to be able to allow CJK characters, and >> any other language with non-Latin characters. This is a snap to do if >> you just want to allow 0-9a-zA-Z. But once you get into Unicode land, it >> seems to be a whole other ballgame.To allow anything that is a letterlike character in any language (or in some languages) you could make use of Unicode Regular Expressions in combination with suitable character properties like "Letter" or script names like "Hiragana" or "Han".See here for more information: http://www.regular-expressions.info/unicode.html http://unicode.org/reports/tr18/IMHO, only whitelist.Only whitelist, from my point of view too. When blacklisting, you will always miss something that will backfire at one point.Of course, all this is not excuse for not using pre-compiled SQL queries with placeholders, or whatever they are called in PHP.Fully agreed. Never build your SQL-queries by String-concatenation. Instead, use the mechanisms that your progamming environment provides.Cheers, Peter
- Follow-Ups:
- References:
- [tlug] Do you whitelist or blacklist utf-8?
- From: Dave M G
- Re: [tlug] Do you whitelist or blacklist utf-8?
- From: Shmuel Fomberg
Home | Main Index | Thread Index
- Prev by Date: [tlug] Answered: Re: Solaris tar: how to pre-pend a parent directory?
- Next by Date: Re: [tlug] Do you whitelist or blacklist utf-8?
- Previous by thread: Re: [tlug] Do you whitelist or blacklist utf-8?
- Next by thread: [tlug] PHP functions to create MySQL syntax? (was: Do you whitelist or blacklist utf-8?)
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links