Navigation Internationalization: can't save Chinese characters

Hi there! It’s now 2025, and I noticed this issue is still around. I’ve found a solution that works and I hope it helps someone out there!
By the way, here are the versions I used:

  • Strapi version: 5.21.0
  • Strapi-plugin-navigation version: 3.2.0

Here’s how to apply the fix:

  1. Navigate to the file: src/index.ts
  2. Replace the content with the following code:
// import type { Core } from '@strapi/strapi';

export default {
  /**
   * An asynchronous register function that runs before
   * your application is initialized.
   *
   * This gives you an opportunity to extend code.
   */
  register(/* { strapi }: { strapi: Core.Strapi } */) {
  },

  /**
   * An asynchronous bootstrap function that runs before
   * your application gets started.
   *
   * This gives you an opportunity to set up your data model,
   * run jobs, or perform some special logic.
   */
  bootstrap({ strapi }) {
    const navigationCommonService = strapi.plugin("navigation").service("common");
    const originalGetSlug = navigationCommonService.getSlug;
    const preprocess = (q) => encodeURIComponent(q);

    navigationCommonService.getSlug = (data) => {
      const query = data.query;
      // Handle undefined, null, or empty query
      if (!query || typeof query !== 'string') {
        return originalGetSlug(data); // Pass the original data structure
      }

      const encodedString = preprocess(query);
      // Create a new data object with the encoded query
      const modifiedData = { ...data, query: encodedString };
      return originalGetSlug(modifiedData);
    };
  },
};