Home Forums Scheme Phone number validation

Viewing 1 reply thread
  • Author
    • #8309
      Jayant ShewaleJayant Shewale

      I am trying to validate the phone number by using below function but not getting proper results.

      1. (parse-phone-country “88802079915799”)
        1. By using above function I am getting “001” as a return value though it is an invalid phone number but it is not showing this as a invalid phone number.
      2. (parse-phone-country “14165552233”)
        1. By using above function I am getting “CA” as return value. That means it is a valid phone number.

      Question: In first case why I am getting “001” as a return value as it is a invalid phone number and country code. The code is using the “(nexj.core.view.converter.PhoneConverter’new  0)” this library can somebody explain the functionality.

    • #8316
      Clayton ChowClayton Chow

      The PhoneConverter eventually uses the function getRegionCodeForNumber for Java class com.google.i18n.phonenumbers.PhoneNumberUtil.

      This could be a behavior of the Java function itself.

      The workaround may to just take this into account;  How specifically are you using parse-phone-country in your logic ?


Viewing 1 reply thread
  • You must be logged in to reply to this topic.