Python - encoding/decoding Windows vs Linux -


having line of code:

print "s\x00a\x00v\x00a" 

produces different output. on windows:

s v 

and on linux:

sava 

what difference between the 2 platform , can remove whitespaces windows case?

the difference @ terminal level.

windows cmd prints zero-char empty whereas linux terminal doesn't print it.

note in pyscripter console or pycrust console (wx-based) s (probably because 0 seen line-termination char). it's not portable :)

to rid of perform replace:

print("s\x00a\x00v\x00a".replace("\x00","")) 

Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -