Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #74005
| Newsgroups | comp.lang.python |
|---|---|
| Date | 2014-07-06 02:05 -0700 |
| References | <b447a73e-cad2-4448-abff-675a3b387e9b@googlegroups.com> |
| Message-ID | <57444726-c79e-499c-aff6-5d268448035f@googlegroups.com> (permalink) |
| Subject | Re: python33, windows, UnicodeEncodeError: 'charmap' codec can't encode characters in position, to print out the file contents to stdout, |
| From | gintare <g.statkute@gmail.com> |
The answer is on page:https://docs.python.org/3.3/howto/unicode.html#reading-and-writing-unicode-data
The correct code:
f=open('C:\Python33\Scripts\lang\langu\svtxt.txt','r', encoding='utf-8')
linef=f.readlines()
print(repr(linef))
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
python33, windows, UnicodeEncodeError: 'charmap' codec can't encode characters in position, to print out the file contents to stdout, gintare <g.statkute@gmail.com> - 2014-07-06 01:45 -0700
Re: python33, windows, UnicodeEncodeError: 'charmap' codec can't encode characters in position, to print out the file contents to stdout, gintare <g.statkute@gmail.com> - 2014-07-06 02:05 -0700
Re: python33, windows, UnicodeEncodeError: 'charmap' codec can't encode characters in position, to print out the file contents to stdout, Dave Angel <davea@davea.name> - 2014-07-06 08:57 -0400
Re: python33, windows, UnicodeEncodeError: 'charmap' codec can't encode characters in position, to print out the file contents to stdout, Rick Johnson <rantingrickjohnson@gmail.com> - 2014-07-06 07:52 -0700
Re: python33, windows, UnicodeEncodeError: 'charmap' codec can't encode characters in position, to print out the file contents to stdout, Terry Reedy <tjreedy@udel.edu> - 2014-07-06 12:14 -0400
Re: python33, windows, UnicodeEncodeError: 'charmap' codec can't encode characters in position, to print out the file contents to stdout, Rick Johnson <rantingrickjohnson@gmail.com> - 2014-07-06 09:53 -0700
Re: python33, windows, UnicodeEncodeError: 'charmap' codec can't encode characters in position, to print out the file contents to stdout, wxjmfauth@gmail.com - 2014-07-06 11:14 -0700
Re: python33, windows, UnicodeEncodeError: 'charmap' codec can't encode characters in position, to print out the file contents to stdout, Rick Johnson <rantingrickjohnson@gmail.com> - 2014-07-06 12:37 -0700
Re: python33, windows, UnicodeEncodeError: 'charmap' codec can't encode characters in position, to print out the file contents to stdout, wxjmfauth@gmail.com - 2014-07-06 23:58 -0700
csiph-web