Quand je rencontre quelqu’un je lui dis ‘hi’.
What you should say
The correct form is “Quand je rencontre quelqu’un, je lui dis « Hi! »”. As, in this context, “lui” can mean both “à lui” and “à elle”, gender is not an issue in this sentence.
Why are your sentences not French
“On” always is a subject, never an object! Therefore, *“
Quand je recontre quelqu’un je on dis ‘hi’.” is not correct.
“L’on” is just a fancy “on” which is used to ease prononciation. I don’t think there is a situation in which you can use “l’on” but not ”on”. In any case, “l’on” still always is a subject.
Quand je rencontre quelqu’un je leur dis ‘hi’” is also incorrect, because “quelqu’un” is singular and thus can’t be referred to by the plural pronoun “leur” (which is the plural form of the “lui” in the correct version).
There is no gender-agnostic third person pronoun, you have to commit.
Sometimes you can avoid implying a biological gender by using a noun and its grammatical gender.
Je vois une personne au loin. Je la regarde approcher.
Sometimes you can use “il ou elle”, but it quickly becomes unwieldy. It only works with the subject pronoun, not with the direct object pronoun. If there is a participle or an adjective that requires gender agreement, it is in the masculine form.
Quelqu’un m’a tapé dans le dos. Il ou elle est parti sans rien dire.
There is no equivalent of the singular use of them in French, and ils/elles takes a gender mark anyway. On is only a subject pronoun, and only means an indeterminate person, not a specific person of unknown gender. Neutral pronouns such as ceci only apply to things; if you refer to a person as ceci, it will be perceived either as a grammatical mistake if you sound foreign, or as offensive otherwise.
By default, to be gender-agnostic, use il/le/lui.
I was wondering if there is an object personal pronoun in French to be used when you don’t want to reveal or are not sure of the gender of the person or the person concerned can be either male or female.
A pronoun has to agree with the gender of the noun to which it refers (which may or may not be related to the sex/gender of the person, personne is feminine for instance and while having a match is far more common it is an interesting style exercise to write a whole story in French where all feminine nouns and pronouns refer to males and all masculine one refer to females; if you want to be gender-equivocal you may try it — depending on the point you want to make, it could be better made by having the sex of characters obvious and not matching the gender of the words used).
When there is no noun, the classical rule is to use the masculine but there is a very strong tendency to use the sex of the person if it is known (that tendency exist as well when the sex doesn’t match the gender of the word and then it is stronger as the distance increase).
Quelqu’un is a masculine pronoun, so I’d not hesitate to use the masculine for pronoun referring to the same person.