Generate PDF with Tamil font problem

Steve D'Aprano steve+python at pearwood.info
Mon Jun 12 07:18:11 EDT 2017


On Mon, 12 Jun 2017 05:51 pm, ccubed2k4 at gmail.com wrote:

> On Saturday, 5 March 2011 10:50:25 UTC+5:30, sath... at e-ndicus.com  wrote:
>> Hi All,
>> 
>>    I am using python's reportlab to print some unicode Tamil characters
>> 'பே'. I added necessary unicode font to reportlab. But It
>> prints the output as 'ேப' (in reverse order). This issue
>> happens for multi-byte characters, whereas for character 'ப' is
>> printed as it is.
>> I am struggling to figure out the issue. Any help would see me on track.
>> 
>> Thank you,
[...]

> I am also facing the same problem with another similar Indian language-
> Malayalam. Has anybody encountered such issue and found any solution for this?

You are replying to a six year old message from 2011. I doubt anyone remembers
the details of that discussion.

Please show us a SIMPLE example of this issue.

If I try this, I get something which appears to be okay:

py> print('\u2986\u3015')
⦆〕

but they don't appear to be Tamil characters?

py> for c in '\u2986\u3015':
...     unicodedata.name(c)
...
'RIGHT WHITE PARENTHESIS'
'RIGHT TORTOISE SHELL BRACKET'


Let me try this instead:

py> for c in (chr(2986), chr(3015)):
...     unicodedata.name(c)
...
'TAMIL LETTER PA'
'TAMIL VOWEL SIGN EE'

That's better!

py> print(''.join([chr(2986), chr(3015)]))
பே


If you want help to diagnose and fix this, you will need to show us some simple
code demonstrating the problem. Also tell us what output you expect, and what
version of Python you are running.





-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.




More information about the Python-list mailing list