Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Localization libraries handle these parts well, since date is same with Europe (and generally stored as time-date objects rather than pure strings). None of the number shenanigans cause problems since these numbers are always stored as IEEE754 or other decimal formats. Money is no problem as well.

However, when you go through an upper() or lower() or anything which plays with capitalization, and if that data is being fed to a hash algorithm or anything which mucks with strings, boy, oh boy...

The easiest way is to sanitize these programmatic parts with forced locale of en_US or plain old "C". If the strings is not facing to the user and never localized, just force its locale. It's the only sane way.



> since date is same with Europe

Do you mean MM-DD-YYYY? No, the vast majority of Europe does DD-MM-YYYY in some form or another.


No, I mean DD-MM-YYYY. We use the same format with the vast majority of Europe.


I'm confused, are you talking about the US? The US for sure does not default to DD-MM-YYYY.


I'm talking about the Turkish Language, its locale and its peculiarities since it has letters "ı" and "İ".

So, I'm talking about Turkish date format. Turkey uses DD-MM-YYYY format, like the most of the Europe.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: