+ /*
+ * Make multiple combining character sequences canonical
+ */
+ if (unicode_combinable(ucs_ch)) {
+ ++combcharcnt; /* start tracking a run */
+ } else if (combcharcnt) {
+ if (combcharcnt > 1) {
+ priortysort(ucsp - combcharcnt, combcharcnt);
+ }
+ combcharcnt = 0; /* start over */
+ }
+ *ucsp++ = swapbytes ? OSSwapInt16(ucs_ch) : ucs_ch;
+ }
+ /*
+ * Make a previous combining sequence canonical
+ */
+ if (combcharcnt > 1) {
+ priortysort(ucsp - combcharcnt, combcharcnt);