BF+CMP: Fix unicode handling, in python 2/3 compatible manner