[Python] From a very short utf8 file obtain the corresponding list of four character unicode...

Discussão em 'Python' iniciado por Stack, Agosto 8, 2025.

  1. Stack

    Stack Membro Participativo

    I am running Macos 15.6 on a Macbook Pro. gawk says that a large number of my file or folder names contain non-ascii characters. I need to identify the 4-digit unicode codepoints corresponding to these non-ascii characters. Note that some of the strange characters are not printable, at least on my Terminal.app, and appear on screen as spaces. Please don't refer me to answers dealing with conversion of unicode codepoints to utf-8. I need the reverse direction: utf8 to unicode codepoints. I imagine that a small Python program could do the trick, but it's taking too much of my time. I have so far proceeded as follows. First use Unix/Linux "find" command plus "gawk" to make a file F of relevant path names. Second use "gawk" to remove all ascii characters from the file F, getting a file G. Third use "hexdump G" or similar to get a short sequence of bytes in hex. But then I'm stuck, unless I learn the necessary Python. It has already been too steep of an uphill journey for me.

    Continue reading...

Compartilhe esta Página