Page 1 of 1
unicode & os detection
Posted: Sat Jan 02, 2010 7:19 pm
by daedalus__
is os detection reliable? there are a couple of unicode characters i would like to use on my website. they work great on linux systems and are available on windows through the wing and web dings fonts. i found some pretty fonts that i could probably include using css but i would like to avoid that feature if possible. im not sure how reliable os detection is though. in the tests i have done i haven't been able to produce results that were unreliable but thats just my system who knows. and just fmi what about uncommon operating systems like ibm ones?
Re: unicode & os detection
Posted: Sat Jan 02, 2010 8:21 pm
by requinix
A very simple OS detection would be like
Code: Select all
if (empty($_SERVER["HTTP_USER_AGENT"])) {
// can't know
} else if (stripos($_SERVER["HTTP_USER_AGENT"], "Win")) {
// probably windows
} else if (stripos($_SERVER["HTTP_USER_AGENT"], "Linux") || stripos($_SERVER["HTTP_USER_AGENT"], "Unix")) {
// probably 'nix
} else if (stripos($_SERVER["HTTP_USER_AGENT"], "Mac")) {
// probably mac
} else {
// don't know - spider?
}
That's the answer to your question.
The answer to your
problem is more along the lines of using images instead of characters or strings.
Re: unicode & os detection
Posted: Sun Jan 03, 2010 12:22 am
by daedalus__
images are a lot less fun. and i understand how to code it i just dont know how reliable it is. i know that browser detection can be icky sometimes so i figured the same may apply to this.