Anonymous avatar Anonymous committed e19eb87

added support for zero width joiner and zero width non-joiner in Combining Character Seqs

Comments (0)

Files changed (1)

 def print_version():
     print os.path.basename(sys.argv[0]) + " v0.1"
 
+def is_combining(unichr, more_combinings = (unicodedata.lookup('zero width joiner'), unicodedata.lookup('zero width non-joiner'))):
+    return unichr in more_combinings or unicodedata.category(unichr)[0] == 'M'
+
 def run(options, args):
     if options.version:
         return print_version()
             i += 1
 
             # glue with next unichr if it's a Combining Character
-            # TODO support zero width joiner, or zero width non-joiner
-            while i != len(line) and unicodedata.category(line[i])[0] == 'M':
+            while i != len(line) and is_combining(line[i]):
                 unichr += line[i]
                 i += 1
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.