File: make-charset-configurable.patch

package info (click to toggle)
imageindex 1.1-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, sid, trixie
  • size: 776 kB
  • sloc: perl: 12,264; makefile: 22
file content (52 lines) | stat: -rw-r--r-- 2,602 bytes parent folder | download | duplicates (3)
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
44
45
46
47
48
49
50
51
52
Description: 
 Make default charset used configurable, set to UTF-8, see:
 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=322552
--- a/imageindex
+++ b/imageindex
@@ -290,6 +290,10 @@
 $thumbxmetatag    = 'ThumbnailX';
 $thumbymetatag    = 'ThumbnailY';
 
+# which charset to use
+#$file_charset     = 'ISO-8859-1';
+$file_charset     = 'UTF-8';
+
 # Any of the above can be overridden in an rc file in the user's home dir
 $rcfile = "$ENV{'HOME'}/.imageindexrc";
 
@@ -1430,7 +1434,7 @@
     print "<HEAD>\n";
     $verstring = &versionstring();
     printf ("<META NAME=\"GENERATOR\" CONTENT=\"imageindex %s\">\n", $verstring);
-    printf ("<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=ISO-8859-1\">\n");
+    printf ("<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=${file_charset}\">\n");
     print "<TITLE>$current_titletext - $filename</TITLE>\n";
     print "<LINK TYPE=\"text/css\" REL=\"stylesheet\" HREF=\"../$stylefile\">\n";
     print "</HEAD>\n<BODY>\n";
@@ -2276,7 +2280,7 @@
     print "<HEAD>\n";
     $verstring = &versionstring();
     printf ("<META NAME=\"GENERATOR\" CONTENT=\"imageindex %s\">\n", $verstring);
-    printf ("<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=ISO-8859-1\">\n");
+    printf ("<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=${file_charset}\">\n");
     if (defined ($write_meta_tag{$titlemetatag})) {
 	print "<META NAME=\"$titlemetatag\" CONTENT=\"$current_titletext\">\n";
     }
@@ -2628,7 +2632,7 @@
     print "<HEAD>\n";
     $verstring = &versionstring();
     printf ("<META NAME=\"GENERATOR\" CONTENT=\"imageindex %s\">\n", $verstring);
-    printf ("<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=ISO-8859-1\">\n");
+    printf ("<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=${file_charset}\">\n");
     print "<LINK TYPE=\"text/css\" REL=\"stylesheet\" HREF=\"../$stylefile\">";
     print "<TITLE>$current_titletext</TITLE>\n";
     print "<LINK TYPE=\"text/css\" REL=\"stylesheet\" HREF=\"../$stylefile\">\n";
@@ -2658,7 +2662,7 @@
     print "<HEAD>\n";
     $verstring = &versionstring();
     printf ("<META NAME=\"GENERATOR\" CONTENT=\"imageindex %s\">\n", $verstring);
-    printf ("<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=ISO-8859-1\">\n");
+    printf ("<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=${file_charset}\">\n");
     print "<LINK TYPE=\"text/css\" REL=\"stylesheet\" HREF=\"../$stylefile\">\n";
     print "<TITLE>$current_titletext</TITLE>\n";
     print "</HEAD>\n<BODY>\n";