main ← fix/unicode-group-name-pagination-url
opened 11:35AM - 16 Feb 26 UTC
When `unicode_usernames` is enabled and the default locale is non-English, `Jobs…::EnsureDbConsistency` renames automatic groups to localized Unicode names (e.g., "admins" → "管理员"). Visiting the group's assigned topics page then triggers a 500 error (`URI::InvalidComponentError`) because the Unicode group name isn't properly encoded when building pagination URLs.
The encoding of route params affected by `unicode_usernames` was scattered across multiple places:
- `:username` was encoded in `page_params`
- `:group_name` was encoded in `construct_url_with`
- `:groupname` (assign plugin) was not encoded anywhere → 500 error
This consolidates all encoding into `construct_url_with`:
- `page_params` now passes raw values for all route params (`:username`, `:group_name`, `:groupname`, `:period`) via a single loop
- `construct_url_with` encodes all three Unicode-sensitive params (`:username`, `:group_name`, `:groupname`) in both `page_params` and `opts` when `unicode_usernames` is enabled
- The unencode block now uses simple string splitting instead of `URI.parse`, which cannot handle Unicode characters in paths
https://meta.discourse.org/t/396092