File: TestAppUnicode.pm

package info (click to toggle)
libdancer-perl 1.3521%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 2,460 kB
  • sloc: perl: 7,436; xml: 2,211; sh: 54; makefile: 32; sql: 5
file content (43 lines) | stat: -rw-r--r-- 783 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package TestAppUnicode;
use Dancer;

get '/string' => sub {
    "\x{1A9}";
};

get '/other/string' => sub {
    forward '/string';
};

get '/param/:param' => sub {
    params('route')->{'param'};
};

get '/view' => sub {
    template 'unicode', { 
        pure_token => 'Ʃ', 
        param_token => params->{'string1'}, 
    };
};

get '/form' => sub {
    debug "params: ".to_json({params()});
    debug "utf8 : é-\x{1AC}";

    template('unicode', { 
        char => "é-\x{E9}",
        string1 => params->{'string1'},
        token => to_json { 'params' => { request->params} }
    })."\x{E9} - string1: ".params->{'string1'}
};

get '/unicode-content-length' => sub {
    "\x{100}0123456789";
};

get '/unicode-content-length-json' => sub {
    { test => "\x{100}" };
};


1;