Was soll die Abfrage

or ($ch >= u'00010000' and $ch <= u'0010FFFF');

Du hast doch kein UCS4.