Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Split first and last names

by LanX (Saint)
on Nov 09, 2022 at 23:11 UTC ( [id://11148078]=note: print w/replies, xml ) Need Help??


in reply to Split first and last names

> but is there a "better" way to do it?

you could start with two input fields instead trying to parse one.

Do you know the famous author "Orson Scott Card"?

Whenever I stumble over him, my neural parser is puzzling again, to which name category the "Scott" belongs.

(I've looked it up already, every time...)

And names can get much harder than this ... see also Names_of_Sun_Yat-sen

> The obvious problem is that it fails with extended characters such as Zoë.

Well, the obvious issue is encoding

Could be your HTML/HTTP settings or your script, or both.

Unicode rulez...

Cheers Rolf
(addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^2: Split first and last names
by Bod (Parson) on Nov 12, 2022 at 23:39 UTC
    Unicode rulez...

    Yes indeed...

    Instead of using the English spelling of my firstname on Facebook - Ian - I dot the first letter so it becomes İan. English speakers don't generally notice but I am learning Turkish and I am part of a few Turkish-speaking Facebook groups.

    Unfortunately, LAN is a rude word in Turkish and Turks see my firstname and it causes them great amusement. After the sixth time it stopped being funny to me... Strangely, whilst English speakers pay no attention to the dot, Turkish speakers see it completely differently and don't associate it in the same way so it solves that problem but does mean I need to be careful with code that reads names from Facebook - which at least one of our site logins does.

      LAN is a rude word in Turkish and Turks see my firstname and it causes them great amusement

      ... while in German, LANX is a rude word causing great amusement. :) Why not use "Bod"? (we Australians are fond of using shortened surnames as nicknames).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11148078]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-04-19 10:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found