Branch: Tag:

2001-09-19

2001-09-19 12:13:51 by Mirar (Pontus Hagland) <pike@sort.mirar.org>

support different nameday charsets

Rev: lib/modules/Calendar.pmod/Events.pmod:1.11

192:    array(array(string)) names=0;    int start=-1,stop=-1;    int leapdayshift=2000; +  string charset="iso-8859-1"; +  function(string:string) decoder=0;       foreach (all[i..i2]/"\n",string line)    {
206: Inside #if 1
   case "leapdayshift":    sscanf(s,"%d",leapdayshift);    break; +  case "charset": +  sscanf(s,"%s",charset); +  object dec=Locale.Charset.decoder(charset); +  decoder=lambda(string s) +  { +  return dec->feed(s)->drain(); +  }; +  break;    case "period":    if (names)    if (res)
232: Inside #if 1
   error("Nameday date doesn't exists:\n%O\n",line);   #endif    if (sizeof(name)) -  names[nd_m_yd[w]+mday-1]=`+(@name); +  { +  name=`+(@name); +  if (decoder) name=map(name,decoder); +  names[nd_m_yd[w]+mday-1]=name; +  }    break;    case "leapday":    sscanf(s,"%{%*[, ]%[^,]%}",name);