Nexmo / nexmo-laravel

Add Vonage functionality such as SMS and voice calling to your Laravel app with this Laravel Service Provider.
MIT License
318 stars 79 forks source link

"At sign" replaced by "inverted question mark sign" #20

Closed eightyfive closed 6 years ago

eightyfive commented 6 years ago

Hi,

The "at sign" of my contact email address is being replaced by an "inverted question mark sign" (escaped?).

Expected contact@propertysumo.com

Actual result contact¿propertysumo.com

The @ sign is part of the SMS default supported characters: https://en.wikipedia.org/wiki/GSM_03.38#GSM_7-bit_default_alphabet_and_extension_table_of_3GPP_TS_23.038_.2F_GSM_03.38

So I don't believe it is being escaped.

Oddly enough, if I try to send the same SMS via Curl, the email address does not get escaped, I receive the SMS normally.

So I figured the problem must come from the Laravel/PHP package.

Any help appreciated. Cheers.

mheap commented 6 years ago

Hey there @eightyfive,

I've tried this with both nexmo/laravel and nexmo/client and can't seem to reproduce the error.

My initial impression is that it may not be a real @, but one of the unicode variants (65312 or 65131). To help debug, could you run the following in your web browser and let us know what value is returned?

javascript:alert('<email>'.charCodeAt(7));
eightyfive commented 6 years ago

Ok, my previous comment was dumb (hence I deleted it).

So it says 64 consistenly.

'@'.charCodeAt(0);

But I cannot figure out if this is as expected, cause I see 64 as the HTML entity (decimal) on this page: https://www.fileformat.info/info/unicode/char/0040/index.htm

Although the true unicode code of @ seems to be 40

mheap commented 6 years ago

That's what we're expecting, so it's unlikely to be a unicode issue.

The next question is which country are you trying to send an SMS to? Each operator works slightly differently

eightyfive commented 6 years ago

I am trying to send SMS to thaï phones (Thailand).

mheap commented 6 years ago

@eightyfive I raised this with our support team and they informed me that you have an open support ticket. Let's continue there :)