Re: What's the easiest way to tell if a character is a letter or not?

2013-04-23 Thread Justin Mclean
Hi, >> Would actually currently pass - although it throws away the GMT+7 and you;re >> left with what ever timezone your computer is in. (Another bug/feature). > > does it actually "cast" the datetime into user's timezone (tz)? that would be > pretty cool. Nope it this case it just takes the d

Re: What's the easiest way to tell if a character is a letter or not?

2013-04-23 Thread Paul Hastings
On 4/23/2013 2:54 PM, Justin Mclean wrote: Hi, no, its a different calendar underlying the system. Sure I'm not trying to fix Flex to cater for any calendar system (yet) just want to get some of the obvious and annoying date issues fixed. well i wouldn't bother much w/locales that don't use

Re: What's the easiest way to tell if a character is a letter or not?

2013-04-23 Thread Paul Hastings
On 4/23/2013 2:50 PM, Justin Mclean wrote: Believe it or that this does exist in Flash and is use by DateTimeFormatter. i guess i should read more ;-) The issue with this class however is there no way to parse a string into a date (the issue here), just format a date object in a nice way, we

Re: What's the easiest way to tell if a character is a letter or not?

2013-04-23 Thread Justin Mclean
Hi, > no, its a different calendar underlying the system. Sure I'm not trying to fix Flex to cater for any calendar system (yet) just want to get some of the obvious and annoying date issues fixed. > 13 นาฬิกา 48 นาที 56 วินาที เวลาอินโดจีน > 13 นาฬิกา 48 นาที 56 วินาที GMT+7 Would actually curr

Re: What's the easiest way to tell if a character is a letter or not?

2013-04-23 Thread Justin Mclean
Hi, > maybe add another method or change the way the format methods worked. taking > coldfusion as a perfect example ;-) it has lsDateFormat method that has the > following signature > > lsDateFormat(date,mask,locale) > > where mask can be user supplied but i argue for following the java style

Re: What's the easiest way to tell if a character is a letter or not?

2013-04-23 Thread Paul Hastings
On 4/23/2013 6:04 AM, Justin Mclean wrote: It should be able to cope with that. Bit of a moot point as there no Thai locale for the SDK but I guess you could use copylocale and give it a go. no, its a different calendar underlying the system. currently its the year 2556BE (buddhist era) which

Re: What's the easiest way to tell if a character is a letter or not?

2013-04-22 Thread Justin Mclean
Hi, > won't matter for countries that don't use the gregorian calendar (like > thailand) as the dates will be wrong anyway. It should be able to cope with that. Bit of a moot point as there no Thai locale for the SDK but I guess you could use copylocale and give it a go. It probably wouldn't d

Re: What's the easiest way to tell if a character is a letter or not?

2013-04-22 Thread Justin Mclean
Hi, > Should the checks be based on locale then? They could be smaller checks > based on one local per... It will keep from trying to have a 1 set of > condition statements to rule them all. Currently it gets the month name for the compiled locale and looks for those (well the first 3 letter

RE: What's the easiest way to tell if a character is a letter or not?

2013-04-22 Thread Gordon Smith
An good utility would be a getUnicodeCategory() API. - Gordon -Original Message- From: Gordon Smith Sent: Monday, April 22, 2013 10:24 AM To: dev@flex.apache.org; 'paul.hasti...@gmail.com' Subject: RE: What's the easiest way to tell if a character is a letter or not? T

RE: What's the easiest way to tell if a character is a letter or not?

2013-04-22 Thread Gordon Smith
: Monday, April 22, 2013 10:02 AM To: dev@flex.apache.org Subject: Re: What's the easiest way to tell if a character is a letter or not? On 4/22/2013 10:23 PM, Justin Mclean wrote: > I'm not that familiar with Chinese date formats.. Can someone provide me with > some examples? gregorian

Re: What's the easiest way to tell if a character is a letter or not?

2013-04-22 Thread Paul Hastings
On 4/22/2013 10:23 PM, Justin Mclean wrote: I'm not that familiar with Chinese date formats.. Can someone provide me with some examples? gregorian calendar, using latest icu4j lib (running full,long,medium,short formats): zh_CN/zh_HK locales date== 2013年4月22日星期一 2013年4月22日 20

RE: What's the easiest way to tell if a character is a letter or not?

2013-04-22 Thread Kessler CTR Mark J
:37 PM To: dev@flex.apache.org Subject: Re: What's the easiest way to tell if a character is a letter or not? On 4/22/2013 9:57 PM, Alex Harui wrote: > My first thought was: 'what about Asia?' won't matter for countries that don't use the gregorian calendar (like tha

Re: What's the easiest way to tell if a character is a letter or not?

2013-04-22 Thread Paul Hastings
On 4/22/2013 9:57 PM, Alex Harui wrote: My first thought was: 'what about Asia?' won't matter for countries that don't use the gregorian calendar (like thailand) as the dates will be wrong anyway. for countries that "sort" of use the gregorian calendar, like china, yes you'd have to expand

Re: What's the easiest way to tell if a character is a letter or not?

2013-04-22 Thread Justin Mclean
Hi, > My first thought was: 'what about Asia?' Both before and after my change this fails: var date:Date = DateFormatter.parseDateString("2008年12月31日"); var df:DateFormatter = new DateFormatter("DD MMM "); Japanese for those who don't know and it fails as it doesn't recognise 年, 月 or 日 as s

Re: What's the easiest way to tell if a character is a letter or not?

2013-04-22 Thread Alex Harui
On 4/22/13 3:47 AM, "Harbs" wrote: > A quick test on this seems to work with all characters in the latin range with > the exception of ß (probably because there's no official capital and > lowercaseŠ) My first thought was: 'what about Asia?' > > On Apr 22, 2013, at 1:41 PM, Harbs wrote: > >

Re: What's the easiest way to tell if a character is a letter or not?

2013-04-22 Thread Harbs
A quick test on this seems to work with all characters in the latin range with the exception of ß (probably because there's no official capital and lowercase…) On Apr 22, 2013, at 1:41 PM, Harbs wrote: > What about this: > > if(letter.toLowerCase() != letter.toUpperCase()){ > // do your s

Re: What's the easiest way to tell if a character is a letter or not?

2013-04-22 Thread Harbs
What about this: if(letter.toLowerCase() != letter.toUpperCase()){ // do your stuff... } I have no idea how performance compares to figuring it out yourself though… On Apr 22, 2013, at 4:05 AM, Justin Mclean wrote: > Hi, > > Anyone know how to work out if a character, including unicode

Re: What's the easiest way to tell if a character is a letter or not?

2013-04-21 Thread Justin Mclean
HI, > If I understand you, I think that is actually the right solution. I think > you want to identify if a sequence of chars is a valid format pattern". This bit of the code is just skipping month names and is broken for locales with anything outside a-z,A-Z in them. This is in parseDateStrin

Re: What's the easiest way to tell if a character is a letter or not?

2013-04-21 Thread Alex Harui
On 4/21/13 8:43 PM, "Justin Mclean" wrote: > Hi, > > Thank Paul for all of that - very interesting and possible one way to go as > the code is under MIT licence. > > I'm now thinking the quick fix solution is to skip anything that's not a space > or format character as that's the smaller set

Re: What's the easiest way to tell if a character is a letter or not?

2013-04-21 Thread Justin Mclean
Hi, Thank Paul for all of that - very interesting and possible one way to go as the code is under MIT licence. I'm now thinking the quick fix solution is to skip anything that's not a space or format character as that's the smaller set. At this point in the code it doesn't really care if the m

Re: What's the easiest way to tell if a character is a letter or not?

2013-04-21 Thread Paul Hastings
take that back, http://as3localedata.riaforge.org/ does have source.

Re: What's the easiest way to tell if a character is a letter or not?

2013-04-21 Thread Paul Hastings
On 4/22/2013 9:23 AM, Justin Mclean wrote: Would that catch characters with accents and the like this? eg "Février", "Décembre", "Ağustos" or "Eylül"? no, you'd need to extend the range a bit, 0x0041-0x00FF. though it depends on the languages/locales you wanted to support, which is somewhat

Re: What's the easiest way to tell if a character is a letter or not?

2013-04-21 Thread Nicholas Kwiatkowski
It looks like you will need to add the following : 192 - 255, exclusive of 247 & 215 (multiplication and division symbol codes). That should cover all the latin characters as well, but it won't do anything for non-latin characters. http://ascii-table.com/ansi-codes.php You may have to add 181,

Re: What's the easiest way to tell if a character is a letter or not?

2013-04-21 Thread Justin Mclean
Hi, > You would probably want to use the charCodeAt() function on the string. Would that catch characters with accents and the like this? eg "Février", "Décembre", "Ağustos" or "Eylül"? That's the issue. Thanks, Justin

Re: What's the easiest way to tell if a character is a letter or not?

2013-04-21 Thread Nicholas Kwiatkowski
You would probably want to use the charCodeAt() function on the string. Assuming you want to search for printable, latin characters, the codes would be 65 - 90 (upper case A-Z) and 97 - 122 (lower case a-z). if ((letter.charCodeAt(0) >= 65) && (letter.charCodeAt(0) <= 90)) || ((letter.charCodeAt(