File: codepage-1252.c

package info (click to toggle)
abiword 0.7.7-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 20,604 kB
  • ctags: 18,358
  • sloc: cpp: 88,791; ansic: 66,296; sh: 7,777; makefile: 3,397; xml: 687; perl: 361; awk: 273; sed: 36; csh: 28
file content (168 lines) | stat: -rw-r--r-- 3,854 bytes parent folder | download
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
#include <stdlib.h>
#include <stdio.h>
#include "wv.h"

/*
returns 1 if the char has a html name

converts the chars into their html equivalent if
possible
*/
int wvConvert1252ToHtml(U16 char8)
	{
	switch (char8)
		{
		case 11:
            printf("<br>");
            return(1);
        case 30:
        case 31:
        case 45:
            printf("-");
            return(1);
        case 12:
        case 13:
        case 14:
        case 7:
            return(1);
        case 34:
            printf("&quot;");
            return(1);
        case 38:
            printf("&amp;");
            return(1);
        case 60:
            printf("&lt;");
            return(1);
        case 62:
            printf("&gt;");
            return(1);
		/* 
		german characters, im assured that this is the right way to handle them
		by Markus Schulte <markus@dom.de>
		*/
		case 0xc4:
			printf("&Auml;");
			return(1); 
		case 0xe4:
			printf("&auml;");
			return(1); 
		case 0xdc:
			printf("&Uuml;");
			return(1); 
		case 0xfc:
			printf("&uuml;");
			return(1); 
		case 0xd6:
			printf("&Ouml;");
			return(1); 
		case 0xf6:
			printf("&ouml;");
			return(1); 
		case 0xdf:
			printf("&szlig;");
			return(1); 
		/* end german characters */
		case 0x80:
			printf("&euro;"); /*EURO SIGN*/
			return(1); 
		case 0x82:
			printf("&bsquo;");  /*SINGLE LOW-9 QUOTATION MARK*/
			return(1); 
		case 0x83:    
			printf("&fnof;");  /*LATIN SMALL LETTER F WITH HOOK*/
			return(1); 
		case 0x84:    
			printf("&bdquo;");  /*DOUBLE LOW-9 QUOTATION MARK*/
			return(1); 
		case 0x85:    
			printf("...");  /*HORIZONTAL ELLIPSIS*/
#if 0
			printf("&hellip;");  /*HORIZONTAL ELLIPSIS*/
#endif
			return(1); 
		case 0x86:    
			printf("&dagger;");  /*DAGGER*/
			return(1); 
		case 0x87:    
			printf("&Dagger;");  /*DOUBLE DAGGER*/
			return(1); 
		case 0x88:    
			printf("&circ;");  /*MODIFIER LETTER CIRCUMFLEX ACCENT*/
			return(1); 
		case 0x89:    
			printf("&permil;");  /*PER MILLE SIGN*/
			return(1); 
		case 0x8A:    
			printf("&Scaron;");  /*LATIN CAPITAL LETTER S WITH CARON*/
			return(1); 
		case 0x8B:    
			printf("&lsaquo;");  /*SINGLE LEFT-POINTING ANGLE QUOTATION MARK*/
			return(1); 
		case 0x8C:    
			printf("&OElig;");  /*LATIN CAPITAL LIGATURE OE*/
			return(1); 
		case 0x8E:    
			printf("&#381;");  /*LATIN CAPITAL LETTER Z WITH CARON*/
			return(1); 
		case 0x91:    
#if 0
			printf("&lsquo;");  /*LEFT SINGLE QUOTATION MARK*/
#endif
			printf("`");  /*LEFT SINGLE QUOTATION MARK*/
			return(1); 
		case 0x92:    
#if 0
			printf("&rsquo;");  /*RIGHT SINGLE QUOTATION MARK*/
#endif
			printf("'");  /*RIGHT SINGLE QUOTATION MARK*/
			return(1); 
		case 0x93:    
#if 0
			printf("&ldquo;");  /*LEFT DOUBLE QUOTATION MARK*/
#endif
			printf("\"");  /*LEFT DOUBLE QUOTATION MARK*/
			return(1); 
		case 0x94:    
#if 0
			printf("&rdquo;");  /*RIGHT DOUBLE QUOTATION MARK*/
#endif
			printf("\"");  /*RIGHT DOUBLE QUOTATION MARK*/
			return(1); 
		case 0x95:    
			printf("&bull;");  /*BULLET*/
			return(1); 
		case 0x96:    
			printf("-");  /*EN DASH*/
			return(1); 
		case 0x97:    
			printf("&mdash;");  /*EM DASH*/
			return(1); 
		case 0x98:    
			printf("&tilde;");  /*SMALL TILDE*/
			return(1); 
		case 0x99:    
			printf("&trade;");  /*TRADE MARK SIGN*/
			return(1); 
		case 0x9A:    
			printf("&scaron;");  /*LATIN SMALL LETTER S WITH CARON*/
			return(1); 
		case 0x9B:    
			printf("&rsaquo;");  /*SINGLE RIGHT-POINTING ANGLE QUOTATION MARKS*/
			return(1); 
		case 0x9C:    
			printf("&oelig;");  /*LATIN SMALL LIGATURE OE*/
			return(1); 
		case 0x9E:    
			printf("&382;");  /*LATIN SMALL LETTER Z WITH CARON*/
			return(1); 
		case 0x9F:    
			printf("&Yuml;");  /*LATIN CAPITAL LETTER Y WITH DIAERESIS*/
			return(1); 
		case 0xA0:
			printf("&nbsp;");
			return(1);
		default:
			return(0);
		}
	}