Re: How to print this character u'\u20ac' to DOS terminal

2007-05-30 Thread Tijs
人言落日是天涯,望极天涯不见家 wrote: > Yes, it works, thank you. > But I doubt this way may not work on linux. Maybe I should write some > additional code for supporting both windows and linux OS. Depends on what you want to do. Printing to a DOS terminal is hard in Linux :-) If you write server code, best t

Re: How to print this character u'\u20ac' to DOS terminal

2007-05-30 Thread 人言落日是天涯,望极天涯不见家
On 5月30日, 下午9时03分, Tijs <[EMAIL PROTECTED]> wrote: > ??? wrote: > > But the string contained the u'\u20ac' is get from remote host. Is > > there any method to decode it to the local 'mbcs'? > > remote_string = u'\u20ac' > try: >local_string = remote_string.encode('mbcs') > except: >

Re: How to print this character u'\u20ac' to DOS terminal

2007-05-30 Thread Tijs
??? wrote: > But the string contained the u'\u20ac' is get from remote host. Is > there any method to decode it to the local 'mbcs'? remote_string = u'\u20ac' try: local_string = remote_string.encode('mbcs') except: # no mbcs equivalent available print "encoding error" else:

Re: How to print this character u'\u20ac' to DOS terminal

2007-05-30 Thread momobear
On May 30, 3:05 pm, 人言落日是天涯,望极天涯不见家 <[EMAIL PROTECTED]> wrote: > On 5月30日, 下午1时23分, "Martin v. Lo"wis" <[EMAIL PROTECTED]> wrote: > > > > > 人言落日是天涯,望极天涯不见家 schrieb: > > > > Who could explain the follow issue ? > > print u'\u0394' > > > Δ > > print u'\u20ac' > > > Traceback (most recent ca

Re: How to print this character u'\u20ac' to DOS terminal

2007-05-30 Thread momobear
On May 30, 3:05 pm, 人言落日是天涯,望极天涯不见家 <[EMAIL PROTECTED]> wrote: > On 5月30日, 下午1时23分, "Martin v. Lo"wis" <[EMAIL PROTECTED]> wrote: > > > > > 人言落日是天涯,望极天涯不见家 schrieb: > > > > Who could explain the follow issue ? > > print u'\u0394' > > > Δ > > print u'\u20ac' > > > Traceback (most recent ca

Re: How to print this character u'\u20ac' to DOS terminal

2007-05-30 Thread 人言落日是天涯,望极天涯不见家
On 5月30日, 下午1时23分, "Martin v. Lo"wis" <[EMAIL PROTECTED]> wrote: > 人言落日是天涯,望极天涯不见家 schrieb: > > > Who could explain the follow issue ? > print u'\u0394' > > Δ > print u'\u20ac' > > Traceback (most recent call last): > > File "", line 1, in > > UnicodeEncodeError: 'gbk' codec can't enco

Re: How to print this character u'\u20ac' to DOS terminal

2007-05-29 Thread Martin v. Lo
人言落日是天涯,望极天涯不见家 schrieb: > Who could explain the follow issue ? print u'\u0394' > Δ print u'\u20ac' > Traceback (most recent call last): > File "", line 1, in > UnicodeEncodeError: 'gbk' codec can't encode character u'\u20ac' in > position 0: > illegal multibyte sequence > > My termi

How to print this character u'\u20ac' to DOS terminal

2007-05-29 Thread 人言落日是天涯,望极天涯不见家
Who could explain the follow issue ? >>> print u'Δ' Δ >>> print u'�' Traceback (most recent call last): File "", line 1, in UnicodeEncodeError: 'gbk' codec can't encode character u'\x80' in position 0: il legal multibyte sequence >>> or I just put the unicode number >>> print u'\u0394' Δ >>> p