Skip to content

SVNと文字化け


I recently ran into an issue with installing subversion 1.5.6 via MacPort. Namely, I ended up with incorrect encoding of characters (文字化け as it were) as svn tried to display Japanese text where terminal’s LANG was configured incorrectly.

Macintosh:~ wwv$ svn --version
svn, ?\227?\131?\144?\227?\131?\188?\227?\130?\184?\227?\131?\167?\227?\131?\179 1.5.6 (r36142)
   ?\227?\130?\179?\227?\131?\179?\227?\131?\145?\227?\130?\164?\227?\131?\171?\230?\151?\165?\230?\153?\130: Mar  8 2009, 20:28:48
 
Copyright (C) 2000-2008 CollabNet.

then the below rectify this situation of 文字化け.

First and foremost, remember to update your shell’s PATH to point to wherever port installs the binaries; this is typically /opt/local/bin. This will ensure you are not using the default svn that comes installed with your Mac OS X.

If upon checking the version of subversion you will see a snippet like the below:

If you using Apple Terminal’s default shell, then edit ~/.bashrc.

export PATH=/opt/local/bin:/${PATH}

Additionally, in the same file also export LANG to ja_JP.UTF-8, or:

export LANG=ja_JP.UTF-8

Finally, if you are using Terminal on Mac OS X 10.5, then you will also want to disable automatically setting LANG on startup from Preferences > Details.

Turn Off LANG on Startup

When you create a new terminal session, if you again check the version of subversion you should see:

Macintosh:~ wwv$ svn --version
svn, バージョン 1.5.6 (r36142)
   コンパイル日時: Mar  8 2009, 20:28:48
 
Copyright (C) 2000-2008 CollabNet.
Subversion はオープンソースソフトウェアです。
http://subversion.tigris.org/ を参照してください。
この製品には、CollabNet (http://www.Collab.Net/) によって開発されたソフトウェア
が含まれています。
 
以下のリポジトリアクセス (RA) モジュールが利用できます:
 
* ra_neon : Neon を利用して WebDAV (DeltaV) プロトコルでリポジトリにアクセスするモジュール。
  - 'http' スキームを操作します
  - 'https' スキームを操作します
* ra_svn : svn ネットワークプロトコルを使ってリポジトリにアクセスするモジュール。
  - Cyrus SASL 認証を併用
  - 'svn' スキームを操作します
* ra_local : ローカルディスク上のリポジトリにアクセスするモジュール。
  - 'file' スキームを操作します
* ra_serf : serf を利用して WebDAV (DeltaV) プロトコルでリポジトリにアクセスするモジュール。
  - 'http' スキームを操作します
  - 'https' スキームを操作します

Post a Comment

Your email is never published nor shared. Required fields are marked *
*

Connect with Facebook

*