author | wenzelm |
Mon, 11 Feb 2013 14:39:04 +0100 | |
changeset 51085 | d90218288d51 |
parent 50233 | eef21a0726f1 |
child 53194 | 1943db7bc34c |
permissions | -rw-r--r-- |
36862 | 1 |
/* |
33817 | 2 |
* Author: Timothy Bourke, NICTA |
3 |
*/ |
|
4 |
var utf8 = new Object(); |
|
5 |
utf8['\\<supseteq>'] = 'โ'; |
|
6 |
utf8['\\<KK>'] = '๐'; |
|
7 |
utf8['\\<up>'] = 'โ'; |
|
8 |
utf8['\\<otimes>'] = 'โ'; |
|
9 |
utf8['\\<aa>'] = '๐'; |
|
10 |
utf8['\\<dagger>'] = 'โ '; |
|
11 |
utf8['\\<frown>'] = 'โข'; |
|
12 |
utf8['\\<guillemotleft>'] = 'ยซ'; |
|
13 |
utf8['\\<qq>'] = '๐ฎ'; |
|
14 |
utf8['\\<X>'] = '๐ณ'; |
|
15 |
utf8['\\<triangleright>'] = 'โน'; |
|
16 |
utf8['\\<guillemotright>'] = 'ยป'; |
|
17 |
utf8['\\<nu>'] = 'ฮฝ'; |
|
18 |
utf8['\\<sim>'] = 'โผ'; |
|
19 |
utf8['\\<rightharpoondown>'] = 'โ'; |
|
20 |
utf8['\\<p>'] = '๐'; |
|
21 |
utf8['\\<Up>'] = 'โ'; |
|
22 |
utf8['\\<triangleq>'] = 'โ'; |
|
23 |
utf8['\\<nine>'] = '๐ต'; |
|
24 |
utf8['\\<preceq>'] = 'โผ'; |
|
25 |
utf8['\\<nabla>'] = 'โ'; |
|
26 |
utf8['\\<FF>'] = '๐'; |
|
48670
206144b13849
prefer calligrapic \<RR> \<II> over \<Re> \<Im> for "screen" display (NB: official unicode defines only one version of these glyphs, unlike TeX);
wenzelm
parents:
36862
diff
changeset
|
27 |
utf8['\\<II>'] = 'โ'; |
33817 | 28 |
utf8['\\<VV>'] = '๐'; |
29 |
utf8['\\<and>'] = 'โง'; |
|
30 |
utf8['\\<mapsto>'] = 'โฆ'; |
|
31 |
utf8['\\<ll>'] = '๐ฉ'; |
|
32 |
utf8['\\<F>'] = 'โฑ'; |
|
33 |
utf8['\\<degree>'] = 'ยฐ'; |
|
34 |
utf8['\\<beta>'] = 'ฮฒ'; |
|
35 |
utf8['\\<Colon>'] = 'โท'; |
|
36 |
utf8['\\<bool>'] = '๐น'; |
|
37 |
utf8['\\<e>'] = '๐พ'; |
|
38 |
utf8['\\<lozenge>'] = 'โ'; |
|
39 |
utf8['\\<u>'] = '๐'; |
|
40 |
utf8['\\<sharp>'] = 'โฏ'; |
|
41 |
utf8['\\<Longleftrightarrow>'] = 'โบ'; |
|
42 |
utf8['\\<Otimes>'] = 'โจ'; |
|
43 |
utf8['\\<EE>'] = '๐'; |
|
44 |
utf8['\\<I>'] = 'โ'; |
|
45 |
utf8['\\<UU>'] = '๐'; |
|
46 |
utf8['\\<exclamdown>'] = 'ยก'; |
|
47 |
utf8['\\<dots>'] = 'โฆ'; |
|
48 |
utf8['\\<N>'] = '๐ฉ'; |
|
49 |
utf8['\\<kk>'] = '๐จ'; |
|
50 |
utf8['\\<plusminus>'] = 'ยฑ'; |
|
51 |
utf8['\\<E>'] = 'โฐ'; |
|
52 |
utf8['\\<triangle>'] = 'โณ'; |
|
53 |
utf8['\\<eta>'] = 'ฮท'; |
|
54 |
utf8['\\<triangleleft>'] = 'โ'; |
|
55 |
utf8['\\<chi>'] = 'ฯ'; |
|
56 |
utf8['\\<z>'] = '๐'; |
|
57 |
utf8['\\<hungarumlaut>'] = 'ห'; |
|
58 |
utf8['\\<partial>'] = 'โ'; |
|
59 |
utf8['\\<three>'] = '๐ฏ'; |
|
60 |
utf8['\\<lesssim>'] = 'โฒ'; |
|
61 |
utf8['\\<subset>'] = 'โ'; |
|
62 |
utf8['\\<H>'] = 'โ'; |
|
63 |
utf8['\\<leftarrow>'] = 'โ'; |
|
64 |
utf8['\\<PP>'] = '๐'; |
|
65 |
utf8['\\<sqsupseteq>'] = 'โ'; |
|
66 |
utf8['\\<R>'] = 'โ'; |
|
67 |
utf8['\\<bowtie>'] = 'โจ'; |
|
68 |
utf8['\\<C>'] = '๐'; |
|
69 |
utf8['\\<ddagger>'] = 'โก'; |
|
70 |
utf8['\\<ff>'] = '๐ฃ'; |
|
71 |
utf8['\\<turnstile>'] = 'โข'; |
|
72 |
utf8['\\<bar>'] = 'ยฆ'; |
|
73 |
utf8['\\<propto>'] = 'โ'; |
|
74 |
utf8['\\<S>'] = '๐ฎ'; |
|
75 |
utf8['\\<vv>'] = '๐ณ'; |
|
76 |
utf8['\\<lhd>'] = 'โฒ'; |
|
77 |
utf8['\\<paragraph>'] = 'ยถ'; |
|
78 |
utf8['\\<mu>'] = 'ฮผ'; |
|
79 |
utf8['\\<rightharpoonup>'] = 'โ'; |
|
80 |
utf8['\\<Inter>'] = 'โ'; |
|
81 |
utf8['\\<o>'] = '๐'; |
|
82 |
utf8['\\<asymp>'] = 'โ'; |
|
83 |
utf8['\\<Leftarrow>'] = 'โ'; |
|
84 |
utf8['\\<Sqinter>'] = 'โจ '; |
|
85 |
utf8['\\<eight>'] = '๐ด'; |
|
86 |
utf8['\\<succeq>'] = 'โฝ'; |
|
87 |
utf8['\\<forall>'] = 'โ'; |
|
88 |
utf8['\\<complex>'] = 'โ'; |
|
89 |
utf8['\\<GG>'] = '๐'; |
|
90 |
utf8['\\<Coprod>'] = 'โ'; |
|
91 |
utf8['\\<L>'] = 'โ'; |
|
92 |
utf8['\\<WW>'] = '๐'; |
|
93 |
utf8['\\<leadsto>'] = 'โ'; |
|
94 |
utf8['\\<D>'] = '๐'; |
|
95 |
utf8['\\<angle>'] = 'โ '; |
|
96 |
utf8['\\<section>'] = 'ยง'; |
|
97 |
utf8['\\<TTurnstile>'] = 'โซ'; |
|
98 |
utf8['\\<mm>'] = '๐ช'; |
|
99 |
utf8['\\<T>'] = '๐ฏ'; |
|
100 |
utf8['\\<alpha>'] = 'ฮฑ'; |
|
101 |
utf8['\\<leftharpoondown>'] = 'โฝ'; |
|
102 |
utf8['\\<rho>'] = 'ฯ'; |
|
103 |
utf8['\\<wrong>'] = 'โ'; |
|
104 |
utf8['\\<l>'] = '๐ '; |
|
105 |
utf8['\\<doteq>'] = 'โ'; |
|
106 |
utf8['\\<times>'] = 'ร'; |
|
107 |
utf8['\\<noteq>'] = 'โ '; |
|
108 |
utf8['\\<rangle>'] = 'โฉ'; |
|
109 |
utf8['\\<div>'] = 'รท'; |
|
110 |
utf8['\\<Longrightarrow>'] = 'โน'; |
|
111 |
utf8['\\<BB>'] = '๐ '; |
|
112 |
utf8['\\<sqsupset>'] = 'โ'; |
|
113 |
utf8['\\<rightarrow>'] = 'โ'; |
|
114 |
utf8['\\<real>'] = 'โ'; |
|
115 |
utf8['\\<hh>'] = '๐ฅ'; |
|
116 |
utf8['\\<Phi>'] = 'ฮฆ'; |
|
117 |
utf8['\\<integral>'] = 'โซ'; |
|
118 |
utf8['\\<CC>'] = 'โญ'; |
|
119 |
utf8['\\<euro>'] = 'โฌ'; |
|
120 |
utf8['\\<xx>'] = '๐ต'; |
|
121 |
utf8['\\<Y>'] = '๐ด'; |
|
122 |
utf8['\\<zeta>'] = 'ฮถ'; |
|
123 |
utf8['\\<longleftarrow>'] = 'โต'; |
|
124 |
utf8['\\<a>'] = '๐บ'; |
|
125 |
utf8['\\<onequarter>'] = 'ยผ'; |
|
126 |
utf8['\\<And>'] = 'โ'; |
|
127 |
utf8['\\<downharpoonright>'] = 'โ'; |
|
128 |
utf8['\\<phi>'] = 'ฯ'; |
|
129 |
utf8['\\<q>'] = '๐'; |
|
130 |
utf8['\\<Rightarrow>'] = 'โ'; |
|
131 |
utf8['\\<clubsuit>'] = 'โฃ'; |
|
132 |
utf8['\\<ggreater>'] = 'โซ'; |
|
133 |
utf8['\\<two>'] = '๐ฎ'; |
|
134 |
utf8['\\<succ>'] = 'โป'; |
|
135 |
utf8['\\<AA>'] = '๐'; |
|
136 |
utf8['\\<lparr>'] = 'โฆ'; |
|
137 |
utf8['\\<Squnion>'] = 'โจ'; |
|
138 |
utf8['\\<HH>'] = 'โ'; |
|
139 |
utf8['\\<sqsubseteq>'] = 'โ'; |
|
140 |
utf8['\\<QQ>'] = '๐'; |
|
141 |
utf8['\\<setminus>'] = 'โ'; |
|
142 |
utf8['\\<Lambda>'] = 'ฮ'; |
|
48670
206144b13849
prefer calligrapic \<RR> \<II> over \<Re> \<Im> for "screen" display (NB: official unicode defines only one version of these glyphs, unlike TeX);
wenzelm
parents:
36862
diff
changeset
|
143 |
utf8['\\<RR>'] = 'โ'; |
33817 | 144 |
utf8['\\<J>'] = '๐ฅ'; |
145 |
utf8['\\<gg>'] = '๐ค'; |
|
146 |
utf8['\\<hyphen>'] = 'ยญ'; |
|
147 |
utf8['\\<B>'] = 'โฌ'; |
|
148 |
utf8['\\<Z>'] = '๐ต'; |
|
149 |
utf8['\\<ww>'] = '๐ด'; |
|
150 |
utf8['\\<lambda>'] = 'ฮป'; |
|
151 |
utf8['\\<onehalf>'] = 'ยฝ'; |
|
152 |
utf8['\\<f>'] = '๐ฟ'; |
|
153 |
utf8['\\<Or>'] = 'โ'; |
|
154 |
utf8['\\<v>'] = '๐'; |
|
155 |
utf8['\\<natural>'] = 'โฎ'; |
|
156 |
utf8['\\<seven>'] = '๐ณ'; |
|
157 |
utf8['\\<Oplus>'] = 'โจ'; |
|
158 |
utf8['\\<subseteq>'] = 'โ'; |
|
159 |
utf8['\\<rfloor>'] = 'โ'; |
|
160 |
utf8['\\<LL>'] = '๐'; |
|
161 |
utf8['\\<Sum>'] = 'โ'; |
|
162 |
utf8['\\<ominus>'] = 'โ'; |
|
163 |
utf8['\\<bb>'] = '๐'; |
|
164 |
utf8['\\<Pi>'] = 'ฮ '; |
|
165 |
utf8['\\<cent>'] = 'ยข'; |
|
166 |
utf8['\\<diamond>'] = 'โ'; |
|
167 |
utf8['\\<mho>'] = 'โง'; |
|
168 |
utf8['\\<O>'] = '๐ช'; |
|
169 |
utf8['\\<rr>'] = '๐ฏ'; |
|
170 |
utf8['\\<twosuperior>'] = 'ยฒ'; |
|
171 |
utf8['\\<leftharpoonup>'] = 'โผ'; |
|
172 |
utf8['\\<pi>'] = 'ฯ'; |
|
173 |
utf8['\\<k>'] = '๐'; |
|
174 |
utf8['\\<star>'] = 'โ'; |
|
175 |
utf8['\\<rightleftharpoons>'] = 'โ'; |
|
176 |
utf8['\\<equiv>'] = 'โก'; |
|
177 |
utf8['\\<langle>'] = 'โจ'; |
|
178 |
utf8['\\<Longleftarrow>'] = 'โธ'; |
|
179 |
utf8['\\<nexists>'] = 'โ'; |
|
180 |
utf8['\\<Odot>'] = 'โจ'; |
|
181 |
utf8['\\<lfloor>'] = 'โ'; |
|
182 |
utf8['\\<sqsubset>'] = 'โ'; |
|
183 |
utf8['\\<SS>'] = '๐'; |
|
184 |
utf8['\\<box>'] = 'โก'; |
|
185 |
utf8['\\<index>'] = 'ฤฑ'; |
|
186 |
utf8['\\<pounds>'] = 'ยฃ'; |
|
187 |
utf8['\\<Upsilon>'] = 'ฮฅ'; |
|
188 |
utf8['\\<ii>'] = '๐ฆ'; |
|
189 |
utf8['\\<hookleftarrow>'] = 'โฉ'; |
|
190 |
utf8['\\<P>'] = '๐ซ'; |
|
191 |
utf8['\\<threesuperior>'] = 'ยณ'; |
|
192 |
utf8['\\<epsilon>'] = 'ฮต'; |
|
193 |
utf8['\\<yy>'] = '๐ถ'; |
|
194 |
utf8['\\<h>'] = '๐'; |
|
195 |
utf8['\\<upsilon>'] = 'ฯ '; |
|
196 |
utf8['\\<x>'] = '๐'; |
|
197 |
utf8['\\<not>'] = 'ยฌ'; |
|
198 |
utf8['\\<le>'] = 'โค'; |
|
199 |
utf8['\\<one>'] = '๐ญ'; |
|
200 |
utf8['\\<cdots>'] = 'โฏ'; |
|
201 |
utf8['\\<some>'] = 'ฯต'; |
|
202 |
utf8['\\<Prod>'] = 'โ'; |
|
203 |
utf8['\\<NN>'] = '๐'; |
|
204 |
utf8['\\<squnion>'] = 'โ'; |
|
205 |
utf8['\\<dd>'] = '๐ก'; |
|
206 |
utf8['\\<top>'] = 'โค'; |
|
207 |
utf8['\\<dieresis>'] = 'ยจ'; |
|
208 |
utf8['\\<tt>'] = '๐ฑ'; |
|
209 |
utf8['\\<U>'] = '๐ฐ'; |
|
210 |
utf8['\\<unlhd>'] = 'โด'; |
|
211 |
utf8['\\<cedilla>'] = 'ยธ'; |
|
212 |
utf8['\\<kappa>'] = 'ฮบ'; |
|
213 |
utf8['\\<amalg>'] = 'โจฟ'; |
|
214 |
utf8['\\<restriction>'] = 'โพ'; |
|
215 |
utf8['\\<struct>'] = 'โ'; |
|
216 |
utf8['\\<m>'] = '๐'; |
|
217 |
utf8['\\<six>'] = '๐ฒ'; |
|
218 |
utf8['\\<midarrow>'] = 'โ'; |
|
219 |
utf8['\\<lbrace>'] = 'โฆ'; |
|
220 |
utf8['\\<lessapprox>'] = 'โช '; |
|
221 |
utf8['\\<MM>'] = '๐'; |
|
222 |
utf8['\\<down>'] = 'โ'; |
|
223 |
utf8['\\<oplus>'] = 'โ'; |
|
224 |
utf8['\\<wp>'] = 'โ'; |
|
225 |
utf8['\\<surd>'] = 'โ'; |
|
226 |
utf8['\\<cc>'] = '๐ '; |
|
227 |
utf8['\\<bottom>'] = 'โฅ'; |
|
228 |
utf8['\\<copyright>'] = 'ยฉ'; |
|
229 |
utf8['\\<ZZ>'] = 'โจ'; |
|
230 |
utf8['\\<union>'] = 'โช'; |
|
231 |
utf8['\\<V>'] = '๐ฑ'; |
|
232 |
utf8['\\<ss>'] = '๐ฐ'; |
|
233 |
utf8['\\<unrhd>'] = 'โต'; |
|
234 |
utf8['\\<onesuperior>'] = 'ยน'; |
|
235 |
utf8['\\<b>'] = '๐ป'; |
|
236 |
utf8['\\<downharpoonleft>'] = 'โ'; |
|
237 |
utf8['\\<cdot>'] = 'โ '; |
|
238 |
utf8['\\<r>'] = '๐'; |
|
239 |
utf8['\\<Midarrow>'] = 'โ'; |
|
240 |
utf8['\\<Down>'] = 'โ'; |
|
241 |
utf8['\\<diamondsuit>'] = 'โข'; |
|
242 |
utf8['\\<rbrakk>'] = 'โง'; |
|
243 |
utf8['\\<lless>'] = 'โช'; |
|
244 |
utf8['\\<longleftrightarrow>'] = 'โท'; |
|
245 |
utf8['\\<prec>'] = 'โบ'; |
|
246 |
utf8['\\<emptyset>'] = 'โ '; |
|
247 |
utf8['\\<rparr>'] = 'โฆ'; |
|
248 |
utf8['\\<Delta>'] = 'ฮ'; |
|
249 |
utf8['\\<XX>'] = '๐'; |
|
250 |
utf8['\\<parallel>'] = 'โฅ'; |
|
251 |
utf8['\\<K>'] = '๐ฆ'; |
|
252 |
utf8['\\<nn>'] = '๐ซ'; |
|
253 |
utf8['\\<registered>'] = 'ยฎ'; |
|
254 |
utf8['\\<M>'] = 'โณ'; |
|
255 |
utf8['\\<delta>'] = 'ฮด'; |
|
256 |
utf8['\\<threequarters>'] = 'ยพ'; |
|
257 |
utf8['\\<g>'] = '๐'; |
|
258 |
utf8['\\<cong>'] = 'โ '; |
|
259 |
utf8['\\<tau>'] = 'ฯ'; |
|
260 |
utf8['\\<w>'] = '๐'; |
|
261 |
utf8['\\<ge>'] = 'โฅ'; |
|
262 |
utf8['\\<flat>'] = 'โญ'; |
|
263 |
utf8['\\<zero>'] = '๐ฌ'; |
|
264 |
utf8['\\<Uplus>'] = 'โจ'; |
|
265 |
utf8['\\<longmapsto>'] = 'โผ'; |
|
266 |
utf8['\\<supset>'] = 'โ'; |
|
267 |
utf8['\\<in>'] = 'โ'; |
|
268 |
utf8['\\<sqinter>'] = 'โ'; |
|
269 |
utf8['\\<OO>'] = '๐'; |
|
270 |
utf8['\\<updown>'] = 'โ'; |
|
271 |
utf8['\\<circ>'] = 'โ'; |
|
272 |
utf8['\\<rat>'] = 'โ'; |
|
273 |
utf8['\\<stileturn>'] = 'โฃ'; |
|
274 |
utf8['\\<ee>'] = '๐ข'; |
|
275 |
utf8['\\<Omega>'] = 'ฮฉ'; |
|
276 |
utf8['\\<or>'] = 'โจ'; |
|
277 |
utf8['\\<inverse>'] = 'ยฏ'; |
|
278 |
utf8['\\<rhd>'] = 'โณ'; |
|
279 |
utf8['\\<uu>'] = '๐ฒ'; |
|
280 |
utf8['\\<iota>'] = 'ฮน'; |
|
281 |
utf8['\\<d>'] = '๐ฝ'; |
|
282 |
utf8['\\<questiondown>'] = 'ยฟ'; |
|
283 |
utf8['\\<Union>'] = 'โ'; |
|
284 |
utf8['\\<omega>'] = 'ฯ'; |
|
285 |
utf8['\\<approx>'] = 'โ'; |
|
286 |
utf8['\\<t>'] = '๐'; |
|
287 |
utf8['\\<Updown>'] = 'โ'; |
|
288 |
utf8['\\<spadesuit>'] = 'โ '; |
|
289 |
utf8['\\<five>'] = '๐ฑ'; |
|
290 |
utf8['\\<exists>'] = 'โ'; |
|
291 |
utf8['\\<rceil>'] = 'โ'; |
|
292 |
utf8['\\<JJ>'] = '๐'; |
|
293 |
utf8['\\<minusplus>'] = 'โ'; |
|
294 |
utf8['\\<nat>'] = 'โ'; |
|
295 |
utf8['\\<oslash>'] = 'โ'; |
|
296 |
utf8['\\<A>'] = '๐'; |
|
297 |
utf8['\\<Xi>'] = 'ฮ'; |
|
298 |
utf8['\\<currency>'] = 'ยค'; |
|
299 |
utf8['\\<Turnstile>'] = 'โจ'; |
|
300 |
utf8['\\<hookrightarrow>'] = 'โช'; |
|
301 |
utf8['\\<pp>'] = '๐ญ'; |
|
302 |
utf8['\\<Q>'] = '๐ฌ'; |
|
303 |
utf8['\\<aleph>'] = 'โต'; |
|
304 |
utf8['\\<acute>'] = 'ยด'; |
|
305 |
utf8['\\<xi>'] = 'ฮพ'; |
|
306 |
utf8['\\<simeq>'] = 'โ'; |
|
307 |
utf8['\\<i>'] = '๐'; |
|
308 |
utf8['\\<Join>'] = 'โ'; |
|
309 |
utf8['\\<y>'] = '๐'; |
|
310 |
utf8['\\<lbrakk>'] = 'โฆ'; |
|
311 |
utf8['\\<greatersim>'] = 'โณ'; |
|
312 |
utf8['\\<greaterapprox>'] = 'โช'; |
|
313 |
utf8['\\<longrightarrow>'] = 'โถ'; |
|
314 |
utf8['\\<lceil>'] = 'โ'; |
|
315 |
utf8['\\<Gamma>'] = 'ฮ'; |
|
316 |
utf8['\\<odot>'] = 'โ'; |
|
317 |
utf8['\\<YY>'] = '๐'; |
|
318 |
utf8['\\<infinity>'] = 'โ'; |
|
319 |
utf8['\\<Sigma>'] = 'ฮฃ'; |
|
320 |
utf8['\\<yen>'] = 'ยฅ'; |
|
321 |
utf8['\\<int>'] = 'โค'; |
|
322 |
utf8['\\<tturnstile>'] = 'โฉ'; |
|
323 |
utf8['\\<oo>'] = '๐ฌ'; |
|
324 |
utf8['\\<ointegral>'] = 'โฎ'; |
|
325 |
utf8['\\<gamma>'] = 'ฮณ'; |
|
326 |
utf8['\\<upharpoonleft>'] = 'โฟ'; |
|
327 |
utf8['\\<sigma>'] = 'ฯ'; |
|
328 |
utf8['\\<n>'] = '๐'; |
|
329 |
utf8['\\<rbrace>'] = 'โฆ'; |
|
330 |
utf8['\\<DD>'] = '๐'; |
|
331 |
utf8['\\<notin>'] = 'โ'; |
|
332 |
utf8['\\<j>'] = '๐'; |
|
333 |
utf8['\\<uplus>'] = 'โ'; |
|
334 |
utf8['\\<leftrightarrow>'] = 'โ'; |
|
335 |
utf8['\\<TT>'] = '๐'; |
|
336 |
utf8['\\<bullet>'] = 'โ'; |
|
337 |
utf8['\\<Theta>'] = 'ฮ'; |
|
338 |
utf8['\\<smile>'] = 'โฃ'; |
|
339 |
utf8['\\<G>'] = '๐ข'; |
|
340 |
utf8['\\<jj>'] = '๐ง'; |
|
341 |
utf8['\\<inter>'] = 'โฉ'; |
|
342 |
utf8['\\<Psi>'] = 'ฮจ'; |
|
343 |
utf8['\\<ordfeminine>'] = 'ยช'; |
|
344 |
utf8['\\<W>'] = '๐ฒ'; |
|
345 |
utf8['\\<zz>'] = '๐ท'; |
|
346 |
utf8['\\<theta>'] = 'ฮธ'; |
|
347 |
utf8['\\<ordmasculine>'] = 'ยบ'; |
|
348 |
utf8['\\<c>'] = '๐ผ'; |
|
349 |
utf8['\\<psi>'] = 'ฯ'; |
|
350 |
utf8['\\<s>'] = '๐'; |
|
351 |
utf8['\\<Leftrightarrow>'] = 'โ'; |
|
352 |
utf8['\\<heartsuit>'] = 'โก'; |
|
353 |
utf8['\\<four>'] = '๐ฐ'; |
|
354 |
||
355 |
var re_xsymbol = /\\<.*?>/g; |
|
356 |
||
357 |
function encodequery(ele) { |
|
358 |
var text = ele.value; |
|
359 |
var otext = text; |
|
360 |
var pos = getCaret(ele); |
|
361 |
||
362 |
xsymbols = text.match(re_xsymbol); |
|
363 |
for (i in xsymbols) { |
|
364 |
var repl = utf8[xsymbols[i]]; |
|
365 |
if (repl) { |
|
366 |
text = text.replace(xsymbols[i], repl, "g"); |
|
367 |
} |
|
368 |
} |
|
369 |
||
370 |
if (text != otext) { |
|
371 |
ele.value = text; |
|
372 |
||
373 |
if (pos != -1) { |
|
374 |
pos = pos - (otext.length - text.length); |
|
375 |
setCaret(ele, pos); |
|
376 |
} |
|
377 |
} |
|
378 |
} |
|
379 |
||
380 |
/* from: http://www.webdeveloper.com/forum/showthread.php?t=74982 */ |
|
381 |
function getCaret(obj) { |
|
382 |
var pos = -1; |
|
383 |
||
384 |
if (document.selection) { // IE |
|
385 |
obj.focus (); |
|
386 |
var sel = document.selection.createRange(); |
|
387 |
var sellen = document.selection.createRange().text.length; |
|
388 |
sel.moveStart ('character', -obj.value.length); |
|
389 |
pos = sel.text.length - sellen; |
|
390 |
||
391 |
} else if (obj.selectionStart || obj.selectionStart == '0') { // Gecko |
|
392 |
pos = obj.selectionStart; |
|
393 |
} |
|
394 |
||
395 |
return pos; |
|
396 |
} |
|
397 |
||
398 |
/* from: http://parentnode.org/javascript/working-with-the-cursor-position/ */ |
|
399 |
function setCaret(obj, pos) { |
|
400 |
if (obj.createTextRange) { |
|
401 |
var range = obj.createTextRange(); |
|
402 |
range.move("character", pos); |
|
403 |
range.select(); |
|
404 |
} else if (obj.selectionStart) { |
|
405 |
obj.focus(); |
|
406 |
obj.setSelectionRange(pos, pos); |
|
407 |
} |
|
408 |
} |
|
409 |