Product Category Cache isn't cleared for permalink containing letters in non-latin alphabets
Describe the bug
On product update, the Product Category Cache isn't cleared for permalink containing letters in non-latin alphabets.
The issue is with get_term_link() function which is adding the Category Base /product-category/ without encoding the URL for non-latin alphabets characters.
Example of the URL returned by get_term_link() :
https://www.domain.com/продуктова-категория/%d0%bf%d1%8a%d1%82%d0%b5%d0%ba%d0%b8/%d0%bc%d0%be%d0%b4%d0%b5%d1%80%d0%bd%d0%b8-%d0%bf%d1%8a%d1%82%d0%b5%d0%ba%d0%b8/
We can see that the Category base is not encoded.
To Reproduce
Steps to reproduce the behavior:
- Go on a WordPress with Woocommerce and Cyrillic URLs
- The Product Category URL should have the default Category Base.
- Update a Product.
- The product cache is updated, not the category cache.
Expected behavior
The Product Category Cache should be cleared on product update.
Additional context
Slack discussion: https://wp-media.slack.com/archives/C43T1AYMQ/p1728657382279759 Related ticket: https://secure.helpscout.net/conversation/2724795871/515791?folderId=8127840