Help for this page

Select Code to Download


  1. or download this
      psql=# create database novels owner ron encoding 'UTF8';
    
  2. or download this
      "author","category","title","rating","comment","isbn","publisher","p
    +ublication_date","review_date"
      "Colm Tóibín","Novel","The South","***","-","-","Picador","-","2012-
    +06-12"
    
  3. or download this
      use feature 'unicode_strings';
      use open qw/:std :utf8/;
    ...
      {
        $result = $rs -> create({name => $_, upper_name => uc $_});
      }
    
  4. or download this
      novels=# select * from authors where name like 'Colm%';
       id  |    name     | upper_name
      -----+-------------+-------------
       100 | Colm Tóibín | COLM TóIBíN
      (1 row)
    
  5. or download this
      use feature qw/say unicode_strings/;
      use open qw/:std :utf8/;
    ...
      say "name:   $name.";
      say "decode: $decode.";
      say "json:   $json.";
    
  6. or download this
      ron@zigzag:~/perl.modules/Local-Novels$ perl scripts/test.utf8.pl
      name:   Colm Tóibín.
      decode: Colm Tóibín.
      json:   {"name":"Colm Tóibín"}.
    
  7. or download this
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /
    +>
    
  8. or download this
      use feature 'unicode_strings';
      use Encode 'decode';
    ...
      $output = {results => $result};
    
      return JSON::XS -> new -> utf8(0) -> encode($output);
    
  9. or download this
      return JSON::XS -> new -> utf8(1) -> encode($output);