Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Iceberg] commit message is not encoded as UTF8 (again) #13925

Open
mumez opened this issue Jun 7, 2023 · 4 comments
Open

[Iceberg] commit message is not encoded as UTF8 (again) #13925

mumez opened this issue Jun 7, 2023 · 4 comments

Comments

@mumez
Copy link

mumez commented Jun 7, 2023

Bug description
Commit messages is not encoded as UTF8.
It was reported as #10781 and it was supposed to be fixed by #11226. But the bug was still not fixed.

To Reproduce

  1. From the Iceberg commit window, enter some multibyte string and push 'Commit' button
    (If you hard to enter multibyte string, plese print it the result of ZnUTF8Encoder new decodeBytes: (ByteArray readHexFrom: 'e38182e38184e38186'. This code produces the string 'あいう')`).
    2023-06-07 12_18_31-C__Users_ume_Documents_Pharo_images_Pharo 11 0 - 64bit (stable)_Pharo 11 0 - 64b

  2. Check the commit message by opening repository browser. (Or you can git log from the terminal).

  3. You will see the wrongly encoded commit message.

Expected behavior
Commit message is set correctly, You can read the commit log from Iceberg and terminal.

Screenshots

Entering a commit message from Pharo

2023-06-07 11_46_33-C__Users_ume_Documents_Pharo_images_Pharo 11 0 - 64bit (stable)_Pharo 11 0 - 64b

Git log shows corrupt commit message

2023-06-07 11_47_26-C__Users_ume_Documents_Pharo_images_Pharo 11 0 - 64bit (stable)_Pharo 11 0 - 64b

Pharo git repository browser also shows corrupt commit message

2023-06-07 11_48_22-C__Users_ume_Documents_Pharo_images_Pharo 11 0 - 64bit (stable)_Pharo 11 0 - 64b

Version information:

  • OS: all
  • Pharo Version 11,10, 9
@mumez mumez added the Type: Bug label Jun 7, 2023
@mumez
Copy link
Author

mumez commented Jun 7, 2023

Please reconsider applying the patch I have attached to #10781.
Our team (Allstocker) has been using this trivial patch for years.
It just removes an unnecessary #utf8Encoded message sending in IceGitIndex>>commitWithMessage:andParents:.

2023-06-07 11_53_47-C__Users_ume_Documents_Pharo_images_Pharo 11 0 - 64bit (stable)_Pharo 11 0 - 64b

@mumez
Copy link
Author

mumez commented Jun 7, 2023

After the patch

Entering a commit message from Pharo

2023-06-07 11_56_31-C__Users_ume_Documents_Pharo_images_Pharo 11 0 - 64bit (stable)_Pharo 11 0 - 64b

Git log shows commit message properly

2023-06-07 12_24_40-NVIDIA GeForce Overlay

(raw bytes)
2023-06-07 12_07_13-2023-06-07 11_47_26-C__Users_ume_Documents_Pharo_images_Pharo 11 0 - 64bit (stab
'あいう' should be utf8 encoded as %E3%81%82%E3%81%84%E3%81%86, so it is correct.
https://mothereff.in/utf-8#%E3%81%82%E3%81%84%E3%81%86

An online, on-the-fly UTF-8 encoder/decoder.

@guillep
Copy link
Member

guillep commented Jun 7, 2023

Hi @mumez, It's great you have a patch!

Would you please consider making a pull request here? https://github.com/pharo-vcs/iceberg
Also, we have many tests for commits in the Iceberg repository, and there should be a place to improve the test suite with a case for this.

GitHub
Iceberg is the main toolset for handling VCS in Pharo. - GitHub - pharo-vcs/iceberg: Iceberg is the main toolset for handling VCS in Pharo.

@mumez
Copy link
Author

mumez commented Jun 7, 2023

I sent a PR: pharo-vcs/iceberg#1705
I hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants