Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #46083 > unrolled thread
| Started by | Νίκος Γκρ33κ <nikos.gr33k@gmail.com> |
|---|---|
| First post | 2013-05-26 09:36 -0700 |
| Last post | 2013-05-31 08:13 -0700 |
| Articles | 20 on this page of 45 — 13 participants |
Back to article view | Back to comp.lang.python
Encodign issue in Python 3.3.1 (once again) Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-26 09:36 -0700
Re: Encodign issue in Python 3.3.1 (once again) Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-26 11:20 -0700
Re: Encodign issue in Python 3.3.1 (once again) Terry Jan Reedy <tjreedy@udel.edu> - 2013-05-26 16:53 -0400
Re: Encodign issue in Python 3.3.1 (once again) Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-26 14:26 -0700
Re: Encodign issue in Python 3.3.1 (once again) Chris Angelico <rosuav@gmail.com> - 2013-05-27 07:44 +1000
Re: Encodign issue in Python 3.3.1 (once again) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-05-26 23:21 +0100
RE: Encodign issue in Python 3.3.1 (once again) Carlos Nepomuceno <carlosnepomuceno@outlook.com> - 2013-05-27 01:31 +0300
Re: Encodign issue in Python 3.3.1 (once again) Chris Angelico <rosuav@gmail.com> - 2013-05-27 08:32 +1000
Re: Encodign issue in Python 3.3.1 (once again) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-05-26 23:51 +0100
Re: Encodign issue in Python 3.3.1 (once again) Tim Roberts <timr@probo.com> - 2013-05-26 19:01 -0700
Re: Encodign issue in Python 3.3.1 (once again) Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-26 22:06 -0700
Re: Encodign issue in Python 3.3.1 (once again) Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-27 07:16 -0700
Re: Encodign issue in Python 3.3.1 (once again) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-05-27 15:45 +0100
Re: Encodign issue in Python 3.3.1 (once again) Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-27 08:37 -0700
Re: Encodign issue in Python 3.3.1 (once again) Chris Angelico <rosuav@gmail.com> - 2013-05-28 01:52 +1000
Re: Encodign issue in Python 3.3.1 (once again) Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-27 09:56 -0700
Re: Encodign issue in Python 3.3.1 (once again) Chris Angelico <rosuav@gmail.com> - 2013-05-28 08:18 +1000
Re: Encodign issue in Python 3.3.1 (once again) Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-27 22:55 -0700
Re: Encodign issue in Python 3.3.1 (once again) rusi <rustompmody@gmail.com> - 2013-05-28 04:56 -0700
Re: Encodign issue in Python 3.3.1 (once again) Michael Torrie <torriem@gmail.com> - 2013-05-27 08:42 -0600
Re: Encodign issue in Python 3.3.1 (once again) Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-27 13:17 -0700
Re: Encodign issue in Python 3.3.1 (once again) Michael Torrie <torriem@gmail.com> - 2013-05-28 08:34 -0600
Re: Encodign issue in Python 3.3.1 (once again) Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-28 09:00 -0700
Re: Encodign issue in Python 3.3.1 (once again) MRAB <python@mrabarnett.plus.com> - 2013-05-28 17:26 +0100
Re: Encodign issue in Python 3.3.1 (once again) Michael Torrie <torriem@gmail.com> - 2013-05-28 10:40 -0600
Re: Encodign issue in Python 3.3.1 (once again) Νίκος Γκρ33κ <support@superhost.gr> - 2013-05-28 09:45 -0700
Re: Encodign issue in Python 3.3.1 (once again) Michael Torrie <torriem@gmail.com> - 2013-05-28 11:17 -0600
Re: Encodign issue in Python 3.3.1 (once again) nagia.retsina@gmail.com - 2013-05-28 11:08 -0700
Re: Encodign issue in Python 3.3.1 (once again) Joel Goldstick <joel.goldstick@gmail.com> - 2013-05-28 14:14 -0400
Re: Encodign issue in Python 3.3.1 (once again) Michael Torrie <torriem@gmail.com> - 2013-05-28 12:19 -0600
Re: Encodign issue in Python 3.3.1 (once again) nagia.retsina@gmail.com - 2013-05-28 12:03 -0700
Re: Encodign issue in Python 3.3.1 (once again) nagia.retsina@gmail.com - 2013-05-28 12:48 -0700
Re: Encodign issue in Python 3.3.1 (once again) nagia.retsina@gmail.com - 2013-05-29 03:30 -0700
Re: Encodign issue in Python 3.3.1 (once again) nagia.retsina@gmail.com - 2013-05-30 00:18 -0700
Re: Encodign issue in Python 3.3.1 (once again) nagia.retsina@gmail.com - 2013-05-30 01:16 -0700
Re: Encodign issue in Python 3.3.1 (once again) Michael Torrie <torriem@gmail.com> - 2013-05-30 03:29 -0600
Re: Encodign issue in Python 3.3.1 (once again) nagia.retsina@gmail.com - 2013-05-30 03:53 -0700
Re: Encodign issue in Python 3.3.1 (once again) nagia.retsina@gmail.com - 2013-05-30 03:56 -0700
Re: Encodign issue in Python 3.3.1 (once again) Chris Angelico <rosuav@gmail.com> - 2013-05-30 21:33 +1000
Re: Encodign issue in Python 3.3.1 (once again) Νίκος Γκρ33κ <support@superhost.gr> - 2013-05-30 04:47 -0700
Re: Encodign issue in Python 3.3.1 (once again) Michael Torrie <torriem@gmail.com> - 2013-05-30 08:35 -0600
Re: Encodign issue in Python 3.3.1 (once again) Chris Angelico <rosuav@gmail.com> - 2013-05-31 00:40 +1000
Re: Encodign issue in Python 3.3.1 (once again) Michael Torrie <torriem@gmail.com> - 2013-05-30 11:01 -0600
Re: Encodign issue in Python 3.3.1 (once again) Chris Angelico <rosuav@gmail.com> - 2013-05-31 03:28 +1000
Re: Encodign issue in Python 3.3.1 (once again) Νικόλαος Κούρας <nikos.gr33k@gmail.com> - 2013-05-31 08:13 -0700
Page 1 of 3 [1] 2 3 Next page →
| From | Νίκος Γκρ33κ <nikos.gr33k@gmail.com> |
|---|---|
| Date | 2013-05-26 09:36 -0700 |
| Subject | Encodign issue in Python 3.3.1 (once again) |
| Message-ID | <7823093c-2c07-4fa0-ae97-960c62f8ff9d@googlegroups.com> |
This is the code that although correct becaus it works with englisg(standARD ASCII letters) it wont with Greek:
if( log ):
name = log
# print specific client header info
cur.execute('''SELECT hits, money FROM clients WHERE name = %s''', (name,) )
data = cur.fetchone()
=======================
The following is the live output of: tail -F /usr/local/apache/logs/error_log &
[Sun May 26 19:24:04 2013] [error] [client 46.12.46.11] Error in sys.excepthook:, referer: http://superhost.gr/cgi-bin/pelatologio.py
[Sun May 26 19:24:04 2013] [error] [client 46.12.46.11] UnicodeEncodeError: 'ascii' codec can't encode characters in position 2050-2056: ordinal not in range(128), referer: http://superhost.gr/cgi-bin/pelatologio.py
[Sun May 26 19:24:04 2013] [error] [client 46.12.46.11] , referer: http://superhost.gr/cgi-bin/pelatologio.py
[Sun May 26 19:24:04 2013] [error] [client 46.12.46.11] Original exception was:, referer: http://superhost.gr/cgi-bin/pelatologio.py
[Sun May 26 19:24:04 2013] [error] [client 46.12.46.11] Traceback (most recent call last):, referer: http://superhost.gr/cgi-bin/pelatologio.py
[Sun May 26 19:24:04 2013] [error] [client 46.12.46.11] File "pelatologio.py", line 122, in <module>, referer: http://superhost.gr/cgi-bin/pelatologio.py
[Sun May 26 19:24:04 2013] [error] [client 46.12.46.11] cur.execute('''SELECT hits, money FROM clients WHERE name = %s''', (name,) ), referer: http://superhost.gr/cgi-bin/pelatologio.py
[Sun May 26 19:24:04 2013] [error] [client 46.12.46.11] File "/opt/python3/lib/python3.3/site-packages/pymysql/cursors.py", line 108, in execute, referer: http://superhost.gr/cgi-bin/pelatologio.py
[Sun May 26 19:24:04 2013] [error] [client 46.12.46.11] query = query.encode(charset), referer: http://superhost.gr/cgi-bin/pelatologio.py
[Sun May 26 19:24:04 2013] [error] [client 46.12.46.11] UnicodeEncodeError: 'latin-1' codec can't encode characters in position 46-52: ordinal not in range(256), referer: http://superhost.gr/cgi-bin/pelatologio.py
I can udnerstand that this is an encoding issue but i dont knwo how to fix this.
please help.
The search works only for english letters as expected but my cleints have Greek name and surnames.
[toc] | [next] | [standalone]
| From | Νίκος Γκρ33κ <nikos.gr33k@gmail.com> |
|---|---|
| Date | 2013-05-26 11:20 -0700 |
| Message-ID | <435277a8-2821-4927-9c99-548d75600f9a@googlegroups.com> |
| In reply to | #46083 |
Any idea how to correct this encoding issue?
[toc] | [prev] | [next] | [standalone]
| From | Terry Jan Reedy <tjreedy@udel.edu> |
|---|---|
| Date | 2013-05-26 16:53 -0400 |
| Message-ID | <mailman.2199.1369601640.3114.python-list@python.org> |
| In reply to | #46083 |
On 5/26/2013 12:36 PM, Νίκος Γκρ33κ wrote:
> This is the code that although correct becaus it works with englisg(standARD ASCII letters) it wont with Greek:
>
> if( log ):
> name = log
> # print specific client header info
> cur.execute('''SELECT hits, money FROM clients WHERE name = %s''', (name,) )
> data = cur.fetchone()
> =======================
>
> The following is the live output of: tail -F /usr/local/apache/logs/error_log &
>
>
> [Sun May 26 19:24:04 2013] [error] [client 46.12.46.11] Error in sys.excepthook:, referer: http://superhost.gr/cgi-bin/pelatologio.py
> [Sun May 26 19:24:04 2013] [error] [client 46.12.46.11] UnicodeEncodeError: 'ascii' codec can't encode characters in position 2050-2056: ordinal not in range(128), referer: http://superhost.gr/cgi-bin/pelatologio.py
> [Sun May 26 19:24:04 2013] [error] [client 46.12.46.11] , referer: http://superhost.gr/cgi-bin/pelatologio.py
> [Sun May 26 19:24:04 2013] [error] [client 46.12.46.11] Original exception was:, referer: http://superhost.gr/cgi-bin/pelatologio.py
> [Sun May 26 19:24:04 2013] [error] [client 46.12.46.11] Traceback (most recent call last):, referer: http://superhost.gr/cgi-bin/pelatologio.py
> [Sun May 26 19:24:04 2013] [error] [client 46.12.46.11] File "pelatologio.py", line 122, in <module>, referer: http://superhost.gr/cgi-bin/pelatologio.py
> [Sun May 26 19:24:04 2013] [error] [client 46.12.46.11] cur.execute('''SELECT hits, money FROM clients WHERE name = %s''', (name,) ), referer: http://superhost.gr/cgi-bin/pelatologio.py
> [Sun May 26 19:24:04 2013] [error] [client 46.12.46.11] File "/opt/python3/lib/python3.3/site-packages/pymysql/cursors.py", line 108, in execute, referer: http://superhost.gr/cgi-bin/pelatologio.py
> [Sun May 26 19:24:04 2013] [error] [client 46.12.46.11] query = query.encode(charset), referer: http://superhost.gr/cgi-bin/pelatologio.py
> [Sun May 26 19:24:04 2013] [error] [client 46.12.46.11] UnicodeEncodeError: 'latin-1' codec can't encode characters in position 46-52: ordinal not in range(256), referer: http://superhost.gr/cgi-bin/pelatologio.py
This appears to be an issue with your mysql database and how you set it
up.. It is using charset='latin-1' whereas you need it to consistently
use charset='utf8' both for storing strings and for retrieval. Check the
mysql manual or ask on a mysql list for how to do that. I have no idea
so don't ask me, or send mail to my emall address.
[toc] | [prev] | [next] | [standalone]
| From | Νίκος Γκρ33κ <nikos.gr33k@gmail.com> |
|---|---|
| Date | 2013-05-26 14:26 -0700 |
| Message-ID | <afb5c351-3ffe-49cf-bc3e-aca5107ad6f4@googlegroups.com> |
| In reply to | #46119 |
No thi is not a mysql issue becaus ei have this line above for storing and retrieval form database. con = pymysql.connect( db = 'metrites', host = 'localhost', user = 'me', passwd = 'somepass', init_command='SET NAMES UTF8' )
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2013-05-27 07:44 +1000 |
| Subject | Re: Encodign issue in Python 3.3.1 (once again) |
| Message-ID | <mailman.2207.1369604706.3114.python-list@python.org> |
| In reply to | #46125 |
On Mon, May 27, 2013 at 7:26 AM, Νίκος Γκρ33κ <nikos.gr33k@gmail.com> wrote: > No thi is not a mysql issue becaus ei have this line above for storing and retrieval form database. > > con = pymysql.connect( db = 'metrites', host = 'localhost', user = 'me', passwd = 'somepass', init_command='SET NAMES UTF8' ) Research MySQL and UTF-8, then see how your command is actually flawed. Then research ESR and asking questions the smart way, and see how your post is also flawed. ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| Date | 2013-05-26 23:21 +0100 |
| Message-ID | <mailman.2212.1369607107.3114.python-list@python.org> |
| In reply to | #46125 |
On 26/05/2013 22:26, Νίκος Γκρ33κ wrote: > No thi is not a mysql issue becaus ei have this line above for storing and retrieval form database. > > con = pymysql.connect( db = 'metrites', host = 'localhost', user = 'me', passwd = 'somepass', init_command='SET NAMES UTF8' ) > No wonder the Greek economy is so screwed up. -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence
[toc] | [prev] | [next] | [standalone]
| From | Carlos Nepomuceno <carlosnepomuceno@outlook.com> |
|---|---|
| Date | 2013-05-27 01:31 +0300 |
| Message-ID | <mailman.2215.1369607525.3114.python-list@python.org> |
| In reply to | #46125 |
---------------------------------------- > To: python-list@python.org > From: breamoreboy@yahoo.co.uk [...] > No wonder the Greek economy is so screwed up. > > -- > If you're using GoogleCrap™ please read this > http://wiki.python.org/moin/GoogleGroupsPython. > > Mark Lawrence LOL LOL LOL LOL LOL LOL HAHAHAHAHA!!!!
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2013-05-27 08:32 +1000 |
| Subject | Re: Encodign issue in Python 3.3.1 (once again) |
| Message-ID | <mailman.2216.1369607534.3114.python-list@python.org> |
| In reply to | #46125 |
On Mon, May 27, 2013 at 8:21 AM, Mark Lawrence <breamoreboy@yahoo.co.uk> wrote: > On 26/05/2013 22:26, Νίκος Γκρ33κ wrote: >> >> No thi is not a mysql issue becaus ei have this line above for storing and >> retrieval form database. >> >> con = pymysql.connect( db = 'metrites', host = 'localhost', user = 'me', >> passwd = 'somepass', init_command='SET NAMES UTF8' ) >> > > No wonder the Greek economy is so screwed up. Do you think the Greek economy would be improved by Python coming with PostgreSQL bindings? That'd push a lot of people onto a better database engine than MySQL. ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| Date | 2013-05-26 23:51 +0100 |
| Subject | Re: Encodign issue in Python 3.3.1 (once again) |
| Message-ID | <mailman.2219.1369608702.3114.python-list@python.org> |
| In reply to | #46125 |
On 26/05/2013 23:32, Chris Angelico wrote: > On Mon, May 27, 2013 at 8:21 AM, Mark Lawrence <breamoreboy@yahoo.co.uk> wrote: >> On 26/05/2013 22:26, Νίκος Γκρ33κ wrote: >>> >>> No thi is not a mysql issue becaus ei have this line above for storing and >>> retrieval form database. >>> >>> con = pymysql.connect( db = 'metrites', host = 'localhost', user = 'me', >>> passwd = 'somepass', init_command='SET NAMES UTF8' ) >>> >> >> No wonder the Greek economy is so screwed up. > > Do you think the Greek economy would be improved by Python coming with > PostgreSQL bindings? That'd push a lot of people onto a better > database engine than MySQL. > > ChrisA > Even the best economies would be improved by Python coming with PostgreSQL bindings, but if and only if the user knew how to use them :) -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence
[toc] | [prev] | [next] | [standalone]
| From | Tim Roberts <timr@probo.com> |
|---|---|
| Date | 2013-05-26 19:01 -0700 |
| Message-ID | <69f5q8hkra42rvpfmbng4f0airgikqf5js@4ax.com> |
| In reply to | #46083 |
????? ???33? <nikos.gr33k@gmail.com> wrote:
>
>This is the code that although correct becaus it works with englisg(standARD ASCII letters) it wont with Greek:
>...
>if( log ):
> name = log
> # print specific client header info
> cur.execute('''SELECT hits, money FROM clients WHERE name = %s''', (name,) )
> data = cur.fetchone()
>=======================
>
>The following is the live output of: tail -F /usr/local/apache/logs/error_log &
>...
> File "/opt/python3/lib/python3.3/site-packages/pymysql/cursors.py", line 108, in execute, referer: http://superhost.gr/cgi-bin/pelatologio.py
> query = query.encode(charset), referer: http://superhost.gr/cgi-bin/pelatologio.py
> UnicodeEncodeError: 'latin-1' codec can't encode characters in position 46-52: ordinal not in range(256), referer: http://superhost.gr/cgi-bin/pelatologio.py
>
>I can udnerstand that this is an encoding issue but i dont knwo how to fix this.
>please help.
While the other responders have a good laugh at your expense, let me
actually point you toward a solution.
The traceback line I left above is the key. It shows that the pymysql
module is trying to encode your Unicode string into an 8-bit character set
in order to send it to the MySQL server. It is THAT conversion that
failed; this has nothing to do with the server (yet).
So, why did it choose 'latin-1'? Because that's the default character set
for pymysql. You could have learned this yourself -- you have the full
source code for pymysql on your machine.
You can override the default character set:
con = pymysql.connect( db = 'metrites', host = 'localhost', user =
'me', passwd = 'somepass', charset='utf-8', init_command='SET NAMES UTF8' )
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
[toc] | [prev] | [next] | [standalone]
| From | Νίκος Γκρ33κ <nikos.gr33k@gmail.com> |
|---|---|
| Date | 2013-05-26 22:06 -0700 |
| Message-ID | <9560d43f-8100-4914-9a71-c30ab479ec35@googlegroups.com> |
| In reply to | #46154 |
But iu have it set up for 'utf-8' as seen in this statement. con = pymysql.connect( db = 'metrites', host = 'localhost', user = 'me', passwd = 'somepass', charset='utf-8', init_command='SET NAMES UTF8' ) Yoiu mean i shoudl chnag eit to greek isoo= (iso-8859-7) but then i store english names and greek names as well, so it has to be a utf-8.
[toc] | [prev] | [next] | [standalone]
| From | Νίκος Γκρ33κ <nikos.gr33k@gmail.com> |
|---|---|
| Date | 2013-05-27 07:16 -0700 |
| Message-ID | <d852ad8c-3be5-4659-a005-ac30f2be3eb8@googlegroups.com> |
| In reply to | #46165 |
I cant solve this plz help!
[toc] | [prev] | [next] | [standalone]
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| Date | 2013-05-27 15:45 +0100 |
| Message-ID | <mailman.2252.1369665933.3114.python-list@python.org> |
| In reply to | #46198 |
On 27/05/2013 15:16, Νίκος Γκρ33κ wrote: > I cant solve this plz help! > Sure, all you need do is get your cheque book out. Also have you ever heard the expression "patience is a virtue"? -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence
[toc] | [prev] | [next] | [standalone]
| From | Νίκος Γκρ33κ <nikos.gr33k@gmail.com> |
|---|---|
| Date | 2013-05-27 08:37 -0700 |
| Message-ID | <529f6d18-65a3-437a-944c-890bbacd9212@googlegroups.com> |
| In reply to | #46201 |
Τη Δευτέρα, 27 Μαΐου 2013 5:45:25 μ.μ. UTC+3, ο χρήστης Mark Lawrence έγραψε: > Sure, all you need do is get your cheque book out. Also have you ever > heard the expression "patience is a virtue"? Well, if i'am gonna pay someone and i will at some point because i want my script to be also re-written using a web framework(Django) it will certainly be someone that can actually provide a so;lution instead of aksing for cheque books.
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2013-05-28 01:52 +1000 |
| Subject | Re: Encodign issue in Python 3.3.1 (once again) |
| Message-ID | <mailman.2254.1369670419.3114.python-list@python.org> |
| In reply to | #46206 |
On Tue, May 28, 2013 at 1:37 AM, Νίκος Γκρ33κ <nikos.gr33k@gmail.com> wrote: > Τη Δευτέρα, 27 Μαΐου 2013 5:45:25 μ.μ. UTC+3, ο χρήστης Mark Lawrence έγραψε: > >> Sure, all you need do is get your cheque book out. Also have you ever >> heard the expression "patience is a virtue"? > > Well, if i'am gonna pay someone and i will at some point because i want my script to be also re-written using a web framework(Django) it will certainly be someone that can actually provide a so;lution instead of aksing for cheque books. So you want to pay someone who won't ask for money? It may be sordid, but you're going to have to discuss money at some point if you're serious about paying someone. Oh, and you may want to hire a typist, too. At the moment, your posts make you appear not to care about the job. ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Νίκος Γκρ33κ <nikos.gr33k@gmail.com> |
|---|---|
| Date | 2013-05-27 09:56 -0700 |
| Subject | Re: Encodign issue in Python 3.3.1 (once again) |
| Message-ID | <9d0cfcdd-0644-4d15-8165-5452c19e57a3@googlegroups.com> |
| In reply to | #46207 |
Τη Δευτέρα, 27 Μαΐου 2013 6:52:32 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > So you want to pay someone who won't ask for money? > It may be sordid, but you're going to have to discuss money at some > point if you're serious about paying someone. > Oh, and you may want to hire a typist, too. At the moment, your posts > make you appear not to care about the job. I always make typos when iam typing fast. And yes at some point i will pay a person from this groups to alter my scripts to utilize web frameworks. To answer your question yes, i will be paying a person from this group that have been providing me solutions to previous questions without laughing at my expense and without requiring money frome to do so. I have 2-3 people in mind. I have managed to turn ALL my python 2.6 scripts to python 3.3.1 except this last problem i have to deal with. http://superhost.gr/?page=pelatologio.py works partiall but only displays info when i click on person names in English, not with Greek names. If someone want to give me a hand with this, please do.
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2013-05-28 08:18 +1000 |
| Subject | Re: Encodign issue in Python 3.3.1 (once again) |
| Message-ID | <mailman.2264.1369693095.3114.python-list@python.org> |
| In reply to | #46209 |
On Tue, May 28, 2013 at 2:56 AM, Νίκος Γκρ33κ <nikos.gr33k@gmail.com> wrote: > Τη Δευτέρα, 27 Μαΐου 2013 6:52:32 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > >> Oh, and you may want to hire a typist, too. At the moment, your posts >> make you appear not to care about the job. > > I always make typos when iam typing fast. Yes, but then you don't go back and correct them before hitting Send, which is what makes you appear to care very little. Typos in real-time chat are understandable (though even on MUDs, most people tend to broadcast less typos than your posts have, because even there there's time to edit before hitting Enter), but with email, it's very easy to spend 60 seconds glancing over your post before you send it. You're using gmail, so chances are all you need to do is use a web browser with a spellchecker and you'll catch all of the typos; I use Google Chrome, and it has the now-prevalent red squiggly lines under all suspected errors. (It's not perfect, of course; quite a few correctly-spelled words are mistakenly flagged. But it's still pretty effective at catching typos.) You're effectively asking people to put in a few minutes' work, sometimes quite a few minutes, to help you. Is it too much to hope that you'll spend one more minute on your posts? This is something that's utterly trivial, yet a window to your mind. It's like boarding an airliner and finding coffee stains on the flip-down trays - the plane flies just fine with those stains, yet the impression they give is that the crew don't care about engine maintenance either. ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Νίκος Γκρ33κ <nikos.gr33k@gmail.com> |
|---|---|
| Date | 2013-05-27 22:55 -0700 |
| Subject | Re: Encodign issue in Python 3.3.1 (once again) |
| Message-ID | <8d7651bd-a4f7-4f8f-bba8-99f5aee6f6b4@googlegroups.com> |
| In reply to | #46228 |
Τη Τρίτη, 28 Μαΐου 2013 1:18:06 π.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > You're effectively asking people to put in a few minutes' work, > sometimes quite a few minutes, to help you. Is it too much to hope > that you'll spend one more minute on your posts? No it is not, you are right, i should be more careful when typing and spend some time to correct before i send my responses. I promise i will not overlook this as well as the blank line google imposes. As fo my initial question any comments-remarks?
[toc] | [prev] | [next] | [standalone]
| From | rusi <rustompmody@gmail.com> |
|---|---|
| Date | 2013-05-28 04:56 -0700 |
| Subject | Re: Encodign issue in Python 3.3.1 (once again) |
| Message-ID | <39469c94-ddef-4492-ab6f-db2a6c61db49@vy4g2000pbc.googlegroups.com> |
| In reply to | #46255 |
On May 28, 10:55 am, Νίκος Γκρ33κ <nikos.gr...@gmail.com> wrote: > Ôç Ôñßôç, 28 ÌáÀïõ 2013 1:18:06 ð.ì. UTC+3, ï ÷ñÞóôçò Chris Angelico Ýãñáøå: > > > You're effectively asking people to put in a few minutes' work, > > sometimes quite a few minutes, to help you. Is it too much to hope > > that you'll spend one more minute on your posts? > > No it is not, you are right, i should be more careful when typing and spend some time to correct before i send my responses. I promise i will not overlook this as well as the blank line google imposes. > > As fo my initial question any comments-remarks? You say you should be more careful to correct your typing and 'promise' to not overlook this. Your next line has a 'fo' instead of a 'for'
[toc] | [prev] | [next] | [standalone]
| From | Michael Torrie <torriem@gmail.com> |
|---|---|
| Date | 2013-05-27 08:42 -0600 |
| Message-ID | <mailman.2251.1369665785.3114.python-list@python.org> |
| In reply to | #46165 |
On 05/26/2013 11:06 PM, Νίκος Γκρ33κ wrote: > But iu have it set up for 'utf-8' as seen in this statement. > > con = pymysql.connect( db = 'metrites', host = 'localhost', user = > 'me', passwd = 'somepass', charset='utf-8', init_command='SET NAMES UTF8' ) That might not help... see below. > > Yoiu mean i shoudl chnag eit to greek isoo= (iso-8859-7) > but then i store english names and greek names as well, so it has to be a utf-8. Right. UTF-8 is the encoding you want. I think your problem is that when the MySQL database was created, it was not created using the UTF-8 mode, but rather latin-1 (despite your init_command which has nothing to do with database creation). You'll want to recreate the database and make double sure you've selected the right character set and collation: http://dev.mysql.com/doc/refman/5.0/en/charset-applications.html At least that should be your first step in debugging this problem. If the database is indeed utf-8, then you can move on to debugging why the python code is choosing latin-1 to encode your query string. That's my two-cents for today.
[toc] | [prev] | [next] | [standalone]
Page 1 of 3 [1] 2 3 Next page →
Back to top | Article view | comp.lang.python
csiph-web