人言落日是天涯,望极天涯不见家 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
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:
>
??? 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:
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
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
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
人言落日是天涯,望极天涯不见家 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
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