Open osam opened 11 years ago
Interesting.
Could it be you are using a different font set between dev and production? Also, what is the character encoding of either installations?
Could it be you are using a different font set between dev and production?
No but when I faced the problem I tried to change the default font and that didn't solve the problem.
what is the character encoding of either installations?
Character encoding of what exactly?
Sorry, the default text encoding, i.e. the output of:
>>> import sys
>>> sys.getdefaultencoding()
Also, are you using a custom generator, or is that the default simplemath generator? See, I think the weird chars before each valid char are due to the fact that PIL (or freetype2) receives an Unicode string (or other encoded multi-byte chars) and misinterprets those as multiple chars.
If this is indeed a custom generator, could you please try and force the returned bits to string?
~$ python Python 2.7.3 (default, Dec 2 2012, 14:33:47) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import sys sys.getdefaultencoding() 'ascii'
are you using a custom generator, or is that the default simplemath generator?
The default but it has nothing to do with the math generator per se I think. I am also getting the rectangles with the letter based captchas. I fixed it temporarily by removing the spaces from ' %s ': https://github.com/mbi/django-simple-captcha/blob/master/captcha/views.py#L52-L54
I had to switch to the letter mode because operators + / * - where also showing as rectangles.
It working correctly on my development machine but when I deployed the app I got these weird characters from nowhere, as you can see from this image:
This is my PIL log:
Your help would be appreciated.