<?xml version="1.0" encoding="UTF-8"?>
<!-- name="generator" content="pyblosxom/1.4.1 7/27/2007" -->
<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">

<rss version="0.91">
<channel>
<title>Блогчетање 12 Dec 2004</title>
<link>https://danilo.segan.org/blog</link>
<description>Данилово блогче</description>
<language>en</language>
<item>
  <title>DejaVu 1.5</title>
  <link>https://danilo.segan.org/blog/razno/dejavu-1.5</link>
  <description><![CDATA[
<p><a href="http://dejavu.sf.net">DejaVu</a> 1.5 has been released.
It now has complete support for Cyrillic.</p>

<p>As a consequence, my <a href="http://kvota.net/fonts/">Bepa</a>
fonts are now deprecated.  Don't use them.  At all.</a>

]]></description>
</item>

<item>
  <title>Accept-language and PHP</title>
  <link>https://danilo.segan.org/blog/razvoj/php-accept-language</link>
  <description><![CDATA[
<p>
<a href="http://primates.ximian.com/~dobey/index.php?date=2004-11-27&month=11&year=2004">Rodney</a>,
below is a function I use to test if visitor prefers Croatian (hr)
over Serbian (sr) when she visits <a
href="http://Prevod.org/">Prevod.org</a> web pages to provide Latin
transcription of the pages.</p>

<pre>
function header_language_compare($default = 'sr', $comparewith = 'hr') {
  $languages=split(',',$_SERVER["HTTP_ACCEPT_LANGUAGE"]);
  $qdefault=0;
  $qcompare=0;
  foreach ($languages as $lang) {
    if (ereg("^$default$",$lang,$regs)) {
      $qdefault=1;
    } elseif (ereg("^$comparewith$",$lang,$regs)) {
      $qcompare=1;
    } elseif (ereg("^$default;[ ]*q=([0-9.]+)$",$lang,$regs)) {
      $qdefault=$regs[1];
    } elseif (ereg("^$comparewith;[ ]*q=([0-9.]+)$",$lang,$regs)) {
      $qcompare=$regs[1];
    }
  }

  if ($qcompare>$qdefault) return 1;
  else return 0;
}
</pre>

<p>If "hr" is more desireable than "sr" (i.e. there's no "sr" at all,
or it has lower "quality" than "hr") according to "Accept-Language"
header, this function will return 1, otherwise 0.  You might want to
use something similar to compare 'en' and 'sq', letting most people
default to 'en' for your blog.</p>

]]></description>
</item>

</channel>
</rss>
