Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

188
Views
How to handle non english character in vue-router as a path

How to have non-English characters in path as a Url?(If not wanting to do anything with server configs!) like the example below:

https://example.com/صفحه_مورد_نظر

Vue-router does not understand non-English characters!


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/صفحه_مورد_نظر',
      name: "home",
      component: Home,
    },  
  ],
});

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The solution is to use a built-in js function called encodeURI(). It is also helpful when dealing with non-English characters in other places like tooltips or when you hover over a link!


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/'+ encodeURI('صفحه_مورد_نظر'),
      name: "home",
      component: Home,
    },  
  ],
});

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!