File: test_encode.adb

package info (click to toggle)
adacgi 1.6-36
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 372 kB
  • sloc: ada: 1,683; sh: 84; makefile: 62
file content (31 lines) | stat: -rw-r--r-- 858 bytes parent folder | download | duplicates (11)
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

-- Test_Encode is a short program to permit interactively trying
-- out the encodings.  Setup the CGI input data, then type.

with Ada.Strings.Unbounded;  use Ada.Strings.Unbounded;
with Text_IO;                use Text_IO;
with Ustrings;               use Ustrings;
with CGI;                    use CGI;

procedure Test_Encode is

   The_Line : Unbounded_String;

begin
   Put_Line("Type in test text and press return.");
   Put_Line("Enter a blank line when finished.");
   loop
      Get_Line (The_Line);
      exit when Length(The_Line) = 0;
      Put (Integer'Image(Length(The_Line)) & ": ");
      Put_Line (The_Line);
      Put("HTML Encoding:");
      Put_Line(HTML_Encode(The_Line));
      Put("URL Encoding:");
      Put_Line(URL_Encode(The_Line));
      Put("URL Decoding:");
      Put_Line(URL_Decode(The_Line));
   end loop;
end Test_Encode;