Skip to content

string().uri() not working with accented characters #2889

@mlarcher

Description

@mlarcher

Support plan

  • is this issue currently blocking your project? (yes/no): yes
  • is this issue affecting a production system? (yes/no): yes

Context

  • node version: 18.10.0
  • module version with issue: 17.1.1
  • last module version without issue:
  • environment (e.g. node, browser, native): node
  • used with (e.g. hapi application, another framework, standalone, ...):
  • any other relevant information:

What are you trying to achieve or the steps to reproduce?

const { error } = Joi.string().uri().validate('https://linkedin.com/in/aïssa/');
console.log(error); // there should be no error

What was the result you got?

"value" must be a valid uri] {
  _original: 'https://linkedin.com/in/aïssa/',
  details: [
    {
      message: '"value" must be a valid uri',
      path: [],
      type: 'string.uri',
      context: [Object]
    }
  ]
}

What result did you expect?

no error

Same check with a i instead of the ï in aïssa in the url works as expected

Metadata

Metadata

Assignees

Labels

featureNew functionality or improvement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions