Branch: Tag:

2017-04-08

2017-04-08 10:36:13 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Calendar: tzdata is now a days encoded in UTF-8.

673:    return;    }    +  // Current (2017) tzdata files are in UTF-8. +  catch { +  s = utf8_to_string(s); +  }; +     Zone lastz;    MyRule lastr;   
745:       write("Thinking...\n");    -  string t="#pike "+__MAJOR__+"."+__MINOR__+"\n\n" + TZrules_base; +  string t= "#charset utf-8\n" +  "#pike __REAL_VERSION__\n\n" + TZrules_base;       foreach (arules,MyRule r)    t+=r->dump();
753:    tzrules=compile_string(t)();       mv("TZrules.pmod","TZrules.pmod~"); +  t = string_to_utf8(t);    werror("Writing TZrules.pmod (%d bytes)...",sizeof(t));    Stdio.File("TZrules.pmod","wtc")->write(t);    werror("\n");    -  t="// ----------------------------------------------------------------\n" +  t= "#charset utf-8\n" +  "#pike __REAL_VERSION__\n" +  "// ----------------------------------------------------------------\n"    "// Timezones\n"    "//\n" -  "// NOTE: this file is generated by mkrules.pike;\n" +  "// NOTE: This file is generated by mkrules.pike;\n"    "// please do not edit manually /Mirar\n"    "// ----------------------------------------------------------------\n"    "\n"
807:    "// "+"-"*70+"\n");       mv("TZs.h","TZs.h~"); +  t = string_to_utf8(t);    werror("Writing TZs.h (%d bytes)...",sizeof(t));    Stdio.File("TZs.h","wtc")->write(t);    werror("\n");
818:       // Read and parse the original TZnames.pmod file.    string orig_names = Stdio.read_bytes("TZnames.pmod"); +  catch { +  orig_names = utf8_to_string(orig_names); +  };    array(string) fragments = orig_names/" zones=";    if (sizeof(fragments) == 1) fragments = orig_names/" zones =";    if (sizeof(fragments) > 2)
889:    }       mv("TZnames.pmod","TZnames.pmod~"); +  t = string_to_utf8(t);    werror("Writing TZnames.pmod (%d bytes)...",sizeof(t));    Stdio.File("TZnames.pmod","wtc")->write(t);    werror("\n");