Re: Handle foreign character web input

2019-07-04 Thread Peter J. Holzer
On 2019-07-03 18:13:20 -0500, Igor Korot wrote: > But as I said, imaging the following situation: > > You are somewhere in Germany and you have a German version of OS > (any OS) > . > You also have a German keyboard (hardware) with German keys. > > Now you are assigned to go to some international

Re: Handle foreign character web input

2019-07-03 Thread Chris Angelico
On Thu, Jul 4, 2019 at 8:12 AM Igor Korot wrote: > > Hi, Chris, > > On Wed, Jul 3, 2019 at 4:41 PM Chris Angelico wrote: > > > > On Thu, Jul 4, 2019 at 7:08 AM Igor Korot wrote: > > > > > > Hi, Thomas, > > > > > > On Sat, Jun 29, 2019 at 11:06 AM Thomas Jollans wrote: > > > > > > > > On 28/06/2

Re: Handle foreign character web input

2019-07-03 Thread Igor Korot
Hi, Chris, On Wed, Jul 3, 2019 at 4:41 PM Chris Angelico wrote: > > On Thu, Jul 4, 2019 at 7:08 AM Igor Korot wrote: > > > > Hi, Thomas, > > > > On Sat, Jun 29, 2019 at 11:06 AM Thomas Jollans wrote: > > > > > > On 28/06/2019 22:25, Tobiah wrote: > > > > A guy comes in and enters his last name

Re: Handle foreign character web input

2019-07-03 Thread Chris Angelico
On Thu, Jul 4, 2019 at 7:08 AM Igor Korot wrote: > > Hi, Thomas, > > On Sat, Jun 29, 2019 at 11:06 AM Thomas Jollans wrote: > > > > On 28/06/2019 22:25, Tobiah wrote: > > > A guy comes in and enters his last name as RÖnngren. > > With a capital Ö in the middle? That's unusual. > > > > > > So what

Re: Handle foreign character web input

2019-07-03 Thread Igor Korot
Hi, Thomas, On Sat, Jun 29, 2019 at 11:06 AM Thomas Jollans wrote: > > On 28/06/2019 22:25, Tobiah wrote: > > A guy comes in and enters his last name as RÖnngren. > With a capital Ö in the middle? That's unusual. > > > > So what did the browser really give me; is it encoded > > in some way, like

Re: Handle foreign character web input

2019-07-03 Thread mm0fmf
On 30/06/2019 15:04, Chris Angelico wrote: ut it looks like our old "Py3's Unicode is buggy" troll is back Yes... check the from field in the posts for confirmation. But it's obvious from the message content anyway. -- https://mail.python.org/mailman/listinfo/python-list

Re: Handle foreign character web input

2019-06-30 Thread Richard Damon
On 6/30/19 10:04 AM, Chris Angelico wrote: > On Sun, Jun 30, 2019 at 10:26 PM Richard Damon > wrote: >> On 6/30/19 4:00 AM, moi wrote: >> > I didn't see who you were quoting, but it looks like our old "Py3's > Unicode is buggy" troll is back (or maybe he never left, he just got > banned from the

Re: Handle foreign character web input

2019-06-30 Thread Michael Torrie
On 06/30/2019 06:21 AM, Richard Damon wrote: > On 6/30/19 4:00 AM, moi wrote: >> Unfortunately not. >> >> The only thing Python succeeds to propose is a mechanism >> which does the opposite of UTF-8 when it comes to handle >> memory *and* - at the same time - which also does the opposite >> of UTF-

Re: Handle foreign character web input

2019-06-30 Thread Chris Angelico
On Sun, Jun 30, 2019 at 10:26 PM Richard Damon wrote: > > On 6/30/19 4:00 AM, moi wrote: > > Le samedi 29 juin 2019 19:25:40 UTC+2, Richard Damon a écrit : > >> > >> Now (as I understand it), all Python (3) 'Strings' are internally > >> Unicode, if you need something with a different encoding it n

Re: Handle foreign character web input

2019-06-30 Thread Richard Damon
On 6/30/19 4:00 AM, moi wrote: > Le samedi 29 juin 2019 19:25:40 UTC+2, Richard Damon a écrit : >> >> Now (as I understand it), all Python (3) 'Strings' are internally >> Unicode, if you need something with a different encoding it needs to be >> in Bytes. >> >> -- > > Unfortunately not. > > The

Re: Handle foreign character web input

2019-06-29 Thread Jon Ribbens via Python-list
On 2019-06-28, Chris Angelico wrote: > On Sat, Jun 29, 2019 at 6:31 AM Tobiah wrote: >> A guy comes in and enters his last name as RÖnngren. >> >> So what did the browser really give me; is it encoded >> in some way, like latin-1? Does it depend on whether >> the name was cut and pasted from a W

Re: Handle foreign character web input

2019-06-29 Thread Alan Meyer via Python-list
On 6/28/19 4:25 PM, Tobiah wrote: A guy comes in and enters his last name as RÖnngren. So what did the browser really give me; is it encoded in some way, like latin-1?  Does it depend on whether the name was cut and pasted from a Word doc. etc? Should I handle these internally as unicode?  Right

Re: Handle foreign character web input

2019-06-29 Thread Richard Damon
On 6/29/19 3:19 AM, Thomas Jollans wrote: > On 28/06/2019 22:25, Tobiah wrote: >> A guy comes in and enters his last name as RÖnngren. > With a capital Ö in the middle? That's unusual. >> >> So what did the browser really give me; is it encoded >> in some way, like latin-1?  Does it depend on wheth

Re: Handle foreign character web input

2019-06-29 Thread Thomas Jollans
On 28/06/2019 22:25, Tobiah wrote: A guy comes in and enters his last name as RÖnngren. With a capital Ö in the middle? That's unusual. So what did the browser really give me; is it encoded in some way, like latin-1?  Does it depend on whether the name was cut and pasted from a Word doc. etc?

Re: Handle foreign character web input

2019-06-28 Thread Terry Reedy
On 6/28/2019 4:25 PM, Tobiah wrote: A guy comes in and enters his last name as RÖnngren. So what did the browser really give me; is it encoded in some way, like latin-1?  Does it depend on whether the name was cut and pasted from a Word doc. etc? Should I handle these internally as unicode?  Rig

Re: Handle foreign character web input

2019-06-28 Thread Akkana Peck
On Sat, Jun 29, 2019 at 6:31 AM Tobiah wrote: > Also, what do people do when searching for a record. > Is there some way to get 'Ronngren' to match the other > possible foreign spellings? SequenceMatcher in difflib can do fuzzy string comparisons and should work for cases like that. There are oth

Re: Handle foreign character web input

2019-06-28 Thread Chris Angelico
On Sat, Jun 29, 2019 at 7:01 AM Tobiah wrote: > > > On 6/28/19 1:33 PM, Chris Angelico wrote:> On Sat, Jun 29, 2019 at 6:31 AM > Tobiah wrote: > >> > >> A guy comes in and enters his last name as RÖnngren. > >> > >> So what did the browser really give me; is it encoded > >> in some way, like lat

Re: Handle foreign character web input

2019-06-28 Thread inhahe
: > > On 6/28/19 1:33 PM, Chris Angelico wrote:> On Sat, Jun 29, 2019 at 6:31 AM > Tobiah wrote: > > >> Also, what do people do when searching for a record. > >> Is there some way to get 'Ronngren' to match the other > >> possible foreign spellings? > > > > I think I've heard of algorithms that

Re: Handle foreign character web input

2019-06-28 Thread Tobiah
On 6/28/19 1:33 PM, Chris Angelico wrote:> On Sat, Jun 29, 2019 at 6:31 AM Tobiah wrote: A guy comes in and enters his last name as RÖnngren. So what did the browser really give me; is it encoded in some way, like latin-1? Does it depend on whether the name was cut and pasted from a Word do

Re: Handle foreign character web input

2019-06-28 Thread Chris Angelico
On Sat, Jun 29, 2019 at 6:31 AM Tobiah wrote: > > A guy comes in and enters his last name as RÖnngren. > > So what did the browser really give me; is it encoded > in some way, like latin-1? Does it depend on whether > the name was cut and pasted from a Word doc. etc? > Should I handle these inter

Handle foreign character web input

2019-06-28 Thread Tobiah
A guy comes in and enters his last name as RÖnngren. So what did the browser really give me; is it encoded in some way, like latin-1? Does it depend on whether the name was cut and pasted from a Word doc. etc? Should I handle these internally as unicode? Right now my database tables are latin-1