Closed rogerfar closed 10 months ago
Hi @rogerfar,
Your problem is because your User Agent string contains +
instead of space character.
If you replace the + with space like this:
Mozilla/5.0 (iPhone; CPU iPhone OS 13_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/77.0.3865.103 Mobile/15E148 Safari/605.1
the result will be the same:
The +
character is user to encode space from URL on https://devicedetector.lw1.at
If you will use this library in .net project, this will not happen because the request UserAgent will be ok. If your UserAgent string comes from other source ..you will need to manipulate this string before send this to Device Detector 👍
I am trying to parse this user agent:
Mozilla/5.0+(iPhone;+CPU+iPhone+OS+13_4+like+Mac+OS+X)+AppleWebKit/605.1.15+(KHTML,+like+Gecko)+CriOS/77.0.3865.103+Mobile/15E148+Safari/605.1
When I use the PHP version: https://devicedetector.lw1.at/Mozilla%2F5.0+(iPhone;+CPU+iPhone+OS+13_4+like+Mac+OS+X)+AppleWebKit%2F605.1.15+(KHTML,+like+Gecko)+CriOS%2F77.0.3865.103+Mobile%2F15E148+Safari%2F605.1
But when using C# latest version: https://dotnetfiddle.net/LIV2yB