Coder Social home page Coder Social logo

Comments (9)

frej avatar frej commented on August 24, 2024

I want migrate from mercurial to git, and this tool works very well indeed,
except all the commit messages(which were wrote in Chinese) became unreadable.

What encoding have you used for the Chinese commit messages?

I tried to reproduce your problem by creating a dummy repository where I
created commit messages containing letters (Γ₯Àâ) which encodes
differently in utf-8 and latin-1 (using hg --encoding). The resulting
logs displays correctly in an utf-8 terminal both before and after
conversion to git. Unless you can give me an exact recipe to reproduce
the problem I don't think it is a fast-export problem.

To salvage the situation I would try to play with the
i18n.commitEncoding or i18n.logOutputEncoding (check 'git config
--help') to see if I could trick git into converting your messages on
the fly. Otherwise have a look at 'git filter-branch' by which you could
massage the messages using iconv after the initial conversion.

from fast-export.

frej avatar frej commented on August 24, 2024

No feedback from reporter for half a year, closing...

from fast-export.

zedxxx avatar zedxxx commented on August 24, 2024

I have the same issue.

Commit messages in my mercurial repo stored in cp1251 (default charset encoding for Russian) and it's impossible correct import it to git.

So, I make some little changes in hg2git.py:

def get_changeset(ui,repo,revision,authors={}):
  node=repo.lookup(revision)
  (manifest,user,(time,timezone),files,desc,extra)=repo.changelog.read(node)
  # +++ Do convert local encoding to UTF8
  user = user.decode('cp1251').encode('utf8')  
  desc = desc.decode('cp1251').encode('utf8')  
  # +++ End encoding convertions
  tz="%+03d%02d" % (-timezone / 3600, ((-timezone % 3600) / 60))
  branch=get_branch(extra.get('branch','master'))
  return (node,manifest,fixup_user(user,authors),(time,tz),files,desc,branch,extra)

I think you need add some option to set correct source encoding for all text fields that you read from changelog.

from fast-export.

frej avatar frej commented on August 24, 2024

I think you need add some option to set correct source encoding for all
text fields that you read from changelog.

Patches welcome :)

from fast-export.

zedxxx avatar zedxxx commented on August 24, 2024

So, maybe you should reopen this issue?

from fast-export.

frej avatar frej commented on August 24, 2024

So, maybe you should reopen this issue?

Could you provide a recipe for creating a repo which exhibits this
issue (or point to a public hg repo)?

from fast-export.

zedxxx avatar zedxxx commented on August 24, 2024

https://bitbucket.org/sas_team/sas.planet.src

from fast-export.

zedxxx avatar zedxxx commented on August 24, 2024

My pull request: #39

from fast-export.

frej avatar frej commented on August 24, 2024

Fixed by e87c9cb, closing issue.

from fast-export.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.