Wiki Title in Japanese #659

Closed
opened 2025-11-02 03:32:10 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @rc-rogers on GitHub (Apr 21, 2017).

  • Gitea version (or commit ref): 1.1.0
  • Git version: 2.7.4
  • Operating system: Ubuntu 16.04 LTS
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

When I create a new Wiki page under a repository with an English title I have no problems editing the page and re-saving the changes, but when I use a Japanese title I can create save it at the first time, but when I go edit the page and try to re-save it I get the following error 500:

[Error Log]
2017/04/21 21:51:49 [...routers/repo/wiki.go:487 EditWikiPost()] [E] EditWikiPage: Failed to remove data/tmp/local-wiki/3/テスト4.md: remove data/tmp/local-wiki/3/テスト4.md: no such file or directory

I checked the files structure, which is as followed:

[Folder Structure]
tmp -
local-wiki -
3 -
.git < Folder
Home.md
%E3%83%86%E3%82%B9%E3%83%88%EF%BC%94.md < Japanese Title file names in Wiki
%E6%97%A5%E6%9C%AC%E8%AA%9E%EF%BC%95.md < Same above

When I do the same test on your try.gitea.io I have no problem re-saving over the Japanese title.

  1. Using Ubuntu 16.04 LTS, which the locale was set to en and did switch to locale set to ja_JP or Japanese system, which didn't fix the issue.

  2. When I actually force rename the file name to the Japanese Charactore.md, then I have no problem re-saving the wiki page.

  3. Not sure if try.gitea.io version Gitea Version: 1.1.0+133-g4bea2191 makes a deference from 1.1.0, but if there is any other suggestions for me to setup or change at this point any advice would help.

It seems when writing the wiki page out it is encoding the charactors to ascii encoding format, which when you read them to wiki they have no problem.

The issue seems to be when you are doing the re-save routine by removing the file and saving the new file. When you are removing the file it is checking exact for the Japanese charactor files and not the encoded file name.

Best would be when writing out the file the first time to either not encode the file and save as it is in the wiki title. The reason is as I explained above when I force renaming the file name to the Japanese chars all seems to be working fine.

I may be wrong, but if I have any other way to correct this on my side I would be more then happy to try.

[Edit]

Following is when I tested on try.gitea.io and there was no problem.

https://try.gitea.io/rrogers/japanese/wiki/%E6%97%A5%E6%9C%AC%E8%AA%9E%E3%83%9A%E3%83%BC%E3%82%B8

Screenshots

If this issue involves the Web Interface, please include a screenshot

Originally created by @rc-rogers on GitHub (Apr 21, 2017). - Gitea version (or commit ref): 1.1.0 - Git version: 2.7.4 - Operating system: Ubuntu 16.04 LTS - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - [ ] Not relevant - Log gist: ## Description When I create a new Wiki page under a repository with an English title I have no problems editing the page and re-saving the changes, but when I use a Japanese title I can create save it at the first time, but when I go edit the page and try to re-save it I get the following error 500: [Error Log] 2017/04/21 21:51:49 [...routers/repo/wiki.go:487 EditWikiPost()] [E] EditWikiPage: Failed to remove data/tmp/local-wiki/3/テスト4.md: remove data/tmp/local-wiki/3/テスト4.md: no such file or directory I checked the files structure, which is as followed: [Folder Structure] tmp - local-wiki - 3 - .git < Folder Home.md %E3%83%86%E3%82%B9%E3%83%88%EF%BC%94.md < Japanese Title file names in Wiki %E6%97%A5%E6%9C%AC%E8%AA%9E%EF%BC%95.md < Same above When I do the same test on your try.gitea.io I have no problem re-saving over the Japanese title. 1) Using Ubuntu 16.04 LTS, which the locale was set to en and did switch to locale set to ja_JP or Japanese system, which didn't fix the issue. 2) When I actually force rename the file name to the Japanese Charactore.md, then I have no problem re-saving the wiki page. 3) Not sure if try.gitea.io version Gitea Version: 1.1.0+133-g4bea2191 makes a deference from 1.1.0, but if there is any other suggestions for me to setup or change at this point any advice would help. It seems when writing the wiki page out it is encoding the charactors to ascii encoding format, which when you read them to wiki they have no problem. The issue seems to be when you are doing the re-save routine by removing the file and saving the new file. When you are removing the file it is checking exact for the Japanese charactor files and not the encoded file name. Best would be when writing out the file the first time to either not encode the file and save as it is in the wiki title. The reason is as I explained above when I force renaming the file name to the Japanese chars all seems to be working fine. I may be wrong, but if I have any other way to correct this on my side I would be more then happy to try. [Edit] Following is when I tested on try.gitea.io and there was no problem. https://try.gitea.io/rrogers/japanese/wiki/%E6%97%A5%E6%9C%AC%E8%AA%9E%E3%83%9A%E3%83%BC%E3%82%B8 ## Screenshots **If this issue involves the Web Interface, please include a screenshot**
Author
Owner

@rc-rogers commented on GitHub (Apr 21, 2017):

I just downloaded the master branch gitea-1.1.0+107-g410af69-linux-amd64 and tried the same routine and it all seemed to work with no problems.

I should of used the latest in the first place, but this issue is solved. My apologies for reporting before trying the latest version.

@rc-rogers commented on GitHub (Apr 21, 2017): I just downloaded the master branch gitea-1.1.0+107-g410af69-linux-amd64 and tried the same routine and it all seemed to work with no problems. I should of used the latest in the first place, but this issue is solved. My apologies for reporting before trying the latest version.
Author
Owner

@bkcsoft commented on GitHub (Apr 26, 2017):

Thanks for reporting that the issue is already fixed 🙂

@bkcsoft commented on GitHub (Apr 26, 2017): Thanks for reporting that the issue is already fixed 🙂
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#659