vergos.niko...@gmail.com writes:
> Τη Πέμπτη, 14 Φεβρουαρίου 2019 - 8:56:31 μ.μ. UTC+2, ο χρήστης MRAB έγραψε:
>
>> It doesn't have a 'b' prefix, so either it's Python 2 or it's a Unicode
>> string that was decoded wrongly from the bytes.
>
> Yes it doesnt have the 'b' prefix so that hexadecimal
vergos.niko...@gmail.com wrote:
[python] con = pymysql.connect( db = 'clientele', user = 'vergos', passwd =
'**', charset = 'utf8' ) cur = con.cursor() [/python]
From that i understand that the names being fetched from the db to pyhton
script are being fetced as utf8, right?
No, I don't th
vergos.niko...@gmail.com wrote:
I just tried:
names = tuple( [s.encode('latin1').decode('utf8') for s in names] )
but i get
UnicodeEncodeError('latin-1', 'Άκης Τσιάμης', 0, 4, 'ordinal not in range(256)')
This suggests that the string you're getting from the database *has*
already been correc
On 02/14/2019 12:02 PM, vergos.niko...@gmail.com wrote:
> Τη Πέμπτη, 14 Φεβρουαρίου 2019 - 8:16:40 μ.μ. UTC+2, ο χρήστης Calvin
> Spealman έγραψε:
>> If you see something like this
>>
>> '\xce\x86\xce\xba\xce\xb7\xcf\x82
>> \xce\xa4\xcf\x83\xce\xb9\xce\xac\xce\xbc\xce\xb7\xcf\x82'
>>
>> then you d
on-list-bounces+david.raymond=tomtom@python.org] On Behalf Of
vergos.niko...@gmail.com
Sent: Thursday, February 14, 2019 2:56 PM
To: python-list@python.org
Subject: Re: Convert a list with wrong encoding to utf8
Τη Πέμπτη, 14 Φεβρουαρίου 2019 - 8:56:31 μ.μ. UTC+2, ο χρήστης MRAB έγραψε:
> It doesn
I'm using Python3 and pymysql and already have charset presnt
[python]
con = pymysql.connect( db = 'clientele', user = 'vergos', passwd = '**',
charset = 'utf8' )
cur = con.cursor()
[/python]
From that i understand that the names being fetched from the db to pyhton
script are being fetced a
Τη Πέμπτη, 14 Φεβρουαρίου 2019 - 8:56:31 μ.μ. UTC+2, ο χρήστης MRAB έγραψε:
> It doesn't have a 'b' prefix, so either it's Python 2 or it's a Unicode
> string that was decoded wrongly from the bytes.
Yes it doesnt have the 'b' prefix so that hexadecimal are representation of
strings and not rep
con = pymysql.connect( db = 'clientele', user = 'vergos', passwd =
'***', charset = 'utf8' )
cur = con.cursor()
Στις Πέμ, 14 Φεβ 2019 στις 9:13 μ.μ., ο/η Igor Korot
έγραψε:
> Hi,
>
> On Thu, Feb 14, 2019 at 1:10 PM wrote:
> >
> > Τη Πέμπτη, 14 Φεβρουαρίου 2019 - 8:16:40 μ.μ. UTC+2, ο χρήστη
Τη Πέμπτη, 14 Φεβρουαρίου 2019 - 9:14:08 μ.μ. UTC+2, ο χρήστης Igor Korot
έγραψε:
> Hi,
>
> On Thu, Feb 14, 2019 at 1:10 PM wrote:
> >
> > Τη Πέμπτη, 14 Φεβρουαρίου 2019 - 8:16:40 μ.μ. UTC+2, ο χρήστης Calvin
> > Spealman έγραψε:
> > > If you see something like this
> > >
> > > '\xce\x86\xce\xb
Hi,
On Thu, Feb 14, 2019 at 1:10 PM wrote:
>
> Τη Πέμπτη, 14 Φεβρουαρίου 2019 - 8:16:40 μ.μ. UTC+2, ο χρήστης Calvin
> Spealman έγραψε:
> > If you see something like this
> >
> > '\xce\x86\xce\xba\xce\xb7\xcf\x82
> > \xce\xa4\xcf\x83\xce\xb9\xce\xac\xce\xbc\xce\xb7\xcf\x82'
> >
> > then you don'
Τη Πέμπτη, 14 Φεβρουαρίου 2019 - 8:16:40 μ.μ. UTC+2, ο χρήστης Calvin Spealman
έγραψε:
> If you see something like this
>
> '\xce\x86\xce\xba\xce\xb7\xcf\x82
> \xce\xa4\xcf\x83\xce\xb9\xce\xac\xce\xbc\xce\xb7\xcf\x82'
>
> then you don't have a string, you have raw bytes. You don't "encode" bytes
On 2019-02-14 18:16, Calvin Spealman wrote:
If you see something like this
'\xce\x86\xce\xba\xce\xb7\xcf\x82
\xce\xa4\xcf\x83\xce\xb9\xce\xac\xce\xbc\xce\xb7\xcf\x82'
then you don't have a string, you have raw bytes. You don't "encode" bytes,
you decode them. If you know this is already encoded
If you see something like this
'\xce\x86\xce\xba\xce\xb7\xcf\x82
\xce\xa4\xcf\x83\xce\xb9\xce\xac\xce\xbc\xce\xb7\xcf\x82'
then you don't have a string, you have raw bytes. You don't "encode" bytes,
you decode them. If you know this is already encoded as UTF-8 then you just
need the decode('utf8'
Τη Πέμπτη, 14 Φεβρουαρίου 2019 - 6:45:29 μ.μ. UTC+2, ο χρήστης Calvin Spealman
έγραψε:
> You can only decode FROM the same encoding you've encoded TO. Any decoding
> must know the input it receives follows the rules of its encoding scheme.
> latin1 is not utf8.
>
> However, in your case, you aren
You can only decode FROM the same encoding you've encoded TO. Any decoding
must know the input it receives follows the rules of its encoding scheme.
latin1 is not utf8.
However, in your case, you aren't seeing problem with the decoding. That
step is never reached. It is failing to encode the stri
On Fri, Feb 15, 2019 at 3:41 AM wrote:
>
> Hello, i have tried the following to chnage encoding to utf8 because for some
> reason it has changed regarding list names
>
> [python]
> #populate client listing into list
> names.append( name )
>
>
> names.appe
Hello, i have tried the following to chnage encoding to utf8 because for some
reason it has changed regarding list names
[python]
#populate client listing into list
names.append( name )
names.append( '' )
names.sort()
for name in names:
17 matches
Mail list logo