Search code examples
htmliosregexipadspecial-characters

How to handle the conflict between Curly/Smart double quote(”) and Straight double quote(") in the HTML input field


On my website login page, there is an issue related to the Smart double quote(”) and Straight double quote("). The issue is that we have a user with a password having a Straight double quote("). For example,

Abcd"123

But in his iPad showing that "Invalid User" while typing the same password. In my research, I found that the iPad keyboard input the password as:

Abcd”123

You can see the difference between the double quotes. It is actually showing a 'smart double-quote' instead of 'straight double-quote'. I could not able to generate the issue while logging with the same user credentials using any other device.

Is there any solution to change the double quote on the iPad keyboard? or Do we need to add any additional regex code for converting the smart double quote with a straight double quote in the website source code(C#)?


Solution

  • This issue is occurred because, iPads have different types of double quotes, So if the user created the password as Abcd"123 and tries to log in with Abcd”123, it will not match with 1st one. And that means it was not an issue, because two passwords are different, and also please don't try to convert the double quotes type to our required type whenever the user enter it, because the user may well known about this type difference and he has given that type of double quote to keep his application much more safe. So try to use the iPhone feature as it is.

    You can also select the double quote type by press and hold the double quote button in the iPad keyboard. When you press and hold on the double quote key on the keyboard, it will look like in the below image.

    enter image description here