hello,

I have a string s which contains the certain line drawing characters:

'──────────────────────────────'

(these are the characters being generated by pressing the keys alt+196)


when i try to print the string 's' to a putty console using the code

print 's: %s' % s

I do get the exact string '──────────────────────────────' as the output on the console which is expected.


but, when i try the following:

for i in s:
          print 'i: %s' % i

the output i get is:

i: q
i: q
i: q
i: q
i: q
i: q
i: q
i: q
i: q
i: q
i: q
i: q
i: q
i: q
i: q

on the console. why is this happenning? is there a way i can print
i: ─
on the console using the same code?

Thanks in advance !!!

ASCII code numbers above 127 gets you into unicode. You have to specify encoding format.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.