Attachment 'downmap_pua.py'
Download 1 # Script downmap_pua.py
2 # Copyright (c) 2009-2009 Quadralay Corporation
3 #
4
5 import stat
6 import sys
7 import os
8
9 # Determine output file name
10 #
11 VarInputFilePath = os.path.abspath(sys.argv[0])
12 VarMapEntriesFilePath = os.path.splitext(VarInputFilePath)[0] + '.xml'
13
14 # Open file
15 #
16 VarMapEntries = open(VarMapEntriesFilePath, 'w')
17
18 VarMapEntries.write('<?xml version="1.0" encoding="utf-8"?>\n')
19 VarMapEntries.write('<MapEntrySets xmlns="urn:WebWorks-XSLT-Extension-Document">\n')
20 VarMapEntries.write(' <MapEntrySet name="%s">\n' % ('DownmapPUA'))
21
22 for VarIndex in range(0, 256):
23 VarPrivateUseAreaCharacter = 61440 + VarIndex;
24 VarDownmappedCharacter = VarIndex;
25
26 VarMapEntries.write(' <MapEntry match="&#x%04X;">&#x%04X;</MapEntry>\n' % (VarPrivateUseAreaCharacter, VarDownmappedCharacter))
27
28 VarMapEntries.write(' </MapEntrySet>\n')
29 VarMapEntries.write('</MapEntrySets>\n')
30
31 # Close file
32 #
33 VarMapEntries.close()
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.