You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Getting Raretoshi information for user RRizzling
Using cached data from 1647482490
Holding 89 is video/mp4 which is unsupported.
Picking another at random. Check count 1.
Holding 83 is image/gif which is unsupported.
Picking another at random. Check count 2.
Picked holding 75 titled Un₿eliever V with ipfshash QmXwt9GFbe6R8R9giVMcqeavAsrUsjnh51V5kHLS5VCPdH
The title of the work is Un₿eliever V with the bitcoin symbol.
However the generated image ends up showing the empty box for unicode characters like this.
The font in use in the vicarioustext file is /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
May need to use a different font, at least for raretoshi.
Run with the following to reproduce
./raretoshi.py RRizzling 75
Tested with the /usr/share/fonts/truetype/noto/NotoMono-Regular.ttf font but it also fails
The text was updated successfully, but these errors were encountered:
You're usually better off using explicit backslash escapes, like \u250c instead of ??, especially if you don't even know how to tell if the file is UTF-8, much less how to fix it.
Second, you almost never want to put non-ASCII characters into a str literal; use a unicode literal unless you have a good reason to do otherwise.
On top of that, if you pass draw.text a str, PIL will decode it with your default charset—which again is probably not UTF-8. So, even if everything else so far were correct, your code would be handing over some UTF-8 to be parsed as cp1252, so mojibake again. Using a unicode literal would avoid this problem entirely; otherwise, you need to pass text.decode('utf-8').
Putting that all together:
text = u"\u250c\u2500\u2510\u2502\u2514\u2518\u255e\u2550\u2561\u2564\u2567\u2558\u255b"
And now the coding declaration and the actual encoding used to save the file don't matter, because the file is pure ASCII.
See the following log output
The title of the work is Un₿eliever V with the bitcoin symbol.
However the generated image ends up showing the empty box for unicode characters like this.
The font in use in the vicarioustext file is /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
May need to use a different font, at least for raretoshi.
Run with the following to reproduce
Tested with the /usr/share/fonts/truetype/noto/NotoMono-Regular.ttf font but it also fails
The text was updated successfully, but these errors were encountered: