Skip to content

Cannot show Chinese correctly #150

Closed

Description

@jinyangcruise

image

image

Activity

  1. dreamtwi commented on Mar 4, 2023

    @dreamtwi

    Same Issue here, using windows 11

  2. markeel commented on May 25, 2023

    @markeel
    Contributor

    This appears to be a problem with the encoding assumptions made when reading from the libgit2 library. That library is simply an array of characters. It could be encoded as anything, but probably is encoded as UTF-8. What it is NOT encoded as a 32 bit unicode encoding, which is what godot::String holds internally. The constructor used assumes that it is the char array is 8 bits which is then converted to a 32 bit internal storage (see String::copy_from() in core/string/ustring.cpp).

    A reasonable fix is to assume all data from libgit2 is UTF8. This should handle almost everyone, For those that have to have their data stored in another encoding, there would need to be an "encoding" parameter probably at the VCS data level (at the same place the user/password/ssh key are recorded.

    I believe that an enhancement should be created for including an "encoding" parameter, and that the current plugin should be updated to assume UTF-8.

    I'll create a pull request with the defaulting to UTF-8, but please discuss if this doesn't seem like a good solution.

  3. jinyangcruise commented on May 25, 2023

    @jinyangcruise
    Author

    I think default to UTF-8 willl be good. On the other hand, For those that have to have their data stored in another encoding, there would need to be an "encoding" parameter probably at the VCS data level, what if I have different encoding files, one encoding parameter is not enough for this situation. This remainds me of some software I used before like Ultra Edit, IntelliJ IDEA and so on, they can show charactors well. I guess they can detect file's encoding or do something to transfer different encoding data to one common encoding maybe? But detecting encoding may be complicated.

  4. Calinou commented on Mar 28, 2024

    @Calinou
    Member

    See #218 (comment) for a possible solution.

  5. added a commit that references this issue on Apr 1, 2024
  6. markeel commented on Apr 1, 2024

    @markeel
    Contributor

    I closed the out of date pull request and created a new one

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions