Jump to content
Chinese-Forums
  • Sign Up

how to convert large file (90+ Mb) from gb2312 to utf-8


Recommended Posts

Posted

Hi!

The problem is that iconv, the main tool for converting files can not process files of such a big size!

PS I'm using a Mac, so any UNIX solutions will work + can emulate WinXP

Posted

Open the file in vi. Type the following commands:

:set encoding=gb2312

:set fileencoding=utf8

:w myfile.utf8

:q

Vi will be using iconv to do the conversions, but it will possibly be doing it line by line so iconv should be able to handle it. Make sure you save to a different filename than the original, just in case something goes wrong and the original 90mb file is lost.

Posted

perl -MEncode -ne "binmode STDOUT, ':utf8'; print decode('euc-cn', $_)" < test.gb > test.u8

Posted

非常感谢!!!

thanks a lot!

Another solution is: open the file using Wenlin... surprisingly, it can handle 90 mb files :)

Join the conversation

You can post now and select your username and password later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Click here to reply. Select text to quote.

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...