Page MenuHomePhabricator

Non-latin commit messages are disappear in history view
Closed, ResolvedPublic

Assigned To
None
Authored By
saggid
Jun 13 2016, 4:57 PM
Referenced Files
F1686090: Screen Shot 2016-06-13 at 10.27.58 AM.png
Jun 13 2016, 5:29 PM
F1686060: pasted_file
Jun 13 2016, 5:05 PM
F1686052: pasted_file
Jun 13 2016, 5:05 PM
F1686039: Screen Shot 2016-06-13 at 10.01.00 AM.png
Jun 13 2016, 5:01 PM
Subscribers

Description

Hello :)

While i open history window in one of my repositories with Russian commit messages, i see what some of commit messages is disappear.

Reproduction bug:

  • create few commits with cyrillic symbols in commit message, for example: "feat группировка ролей по языкам на странице юзеров для более удобного анализа"
  • push this commits to Diffusion repository
  • see disappear commit messages in diffusion

Version information:

Event Timeline

I found source of problem: many lines of code in libphutil and phabricator use a strlen and substr functions instead of using mb_strlen and mb_substr. If you replace this functions to multibyte-analogs, this bug go away)

I can create a pull request for fix this bug.

I can't reproduce this -- rGITTESTaa541e7b324424e201c124dc58588c33e48d8bf5 seems to work fine for me.

Screen Shot 2016-06-13 at 10.01.00 AM.png (980×1 px, 182 KB)

Of course, I've written those symbols in UTF8 so maybe this isn't a valid reproduction case.

Can you push a commit to rGITTEST which demonstrates this problem? You should be able to push commits to that repository.

No, not in full commit info. See history window with all commits of project.

Look at my repo history without bug fixing.

pasted_file (789×1 px, 143 KB)

And after replace strlen and substr to mb_strlen and mb_substr

pasted_file (709×1 px, 142 KB)

saggid renamed this task from Non-UTF8 Commit messages are disappear in history view to Non-latin commit messages are disappear in history view.Jun 13 2016, 5:14 PM

So fast :)) Many thanks for you work)

This commit now appears properly in the history view on this install, so I think the issue is resolved:

Screen Shot 2016-06-13 at 10.27.58 AM.png (212×677 px, 34 KB)

Although using mb_* functions also fixes this particular case, it isn't the correct fix in the general case for all inputs. See PhutilUTF8StringTruncator for some discussion.

Thanks for the report!