3 pages tagged with "c"
As you may know there is such a thing as a leap second, and Dec 31 2008 is a day with a leap second. A couple of hours before New Year I got an idea to catch this leap second. The problem is that Linux uses Unix time and thus ignores leap seconds. Hence if you use time(2) or gettimeofday(2), the lea… read more
Now suppose you want to rid string of malformed utf-8 characters. Here is an example that checks an utf-8 string and replaces all malformed characters with '?'. The same idea as in the previous post. Note, that it checks only encoding, it is possible that encoding is correct, but the symbol doesn't … read more