「ファイルをUTF-8に変換する」の版間の差分
提供:MoodleDocs
Mitsuhiro Yoshida (トーク | 投稿記録) 編集の要約なし |
Mitsuhiro Yoshida (トーク | 投稿記録) 編集の要約なし |
||
1行目: | 1行目: | ||
{{Moodle 1.6}} | {{Moodle 1.6}} | ||
翻訳中です - [[利用者:Mitsuhiro Yoshida|Mitsuhiro Yoshida]] | 翻訳中です - [[利用者:Mitsuhiro Yoshida|Mitsuhiro Yoshida]] 2006年8月24日 (木) 18:29 (CDT) | ||
カスタム言語パックまたはサードパーティモジュールの言語ファイルのようなファイルは、Moodle 1.6のUTF-8データベースで使用する前に、UTF-8に変換する必要があります。 | |||
==*nix like computers== | ==*nix like computers== | ||
10行目: | 10行目: | ||
<code>iconv -f original_charset -t utf-8 originalfile > newfile</code> | <code>iconv -f original_charset -t utf-8 originalfile > newfile</code> | ||
== | ==Windowsコンピュータ== | ||
For Windows, a free tool doesn't exist. However, the conversion may be done by using [[http://www.cygwin.com Cygwin]], a Linux-like environment for Windows, and excecuting the iconv command in that environment. | For Windows, a free tool doesn't exist. However, the conversion may be done by using [[http://www.cygwin.com Cygwin]], a Linux-like environment for Windows, and excecuting the iconv command in that environment. | ||
2006年8月24日 (木) 23:29時点における版
Moodle 1.6
翻訳中です - Mitsuhiro Yoshida 2006年8月24日 (木) 18:29 (CDT)
カスタム言語パックまたはサードパーティモジュールの言語ファイルのようなファイルは、Moodle 1.6のUTF-8データベースで使用する前に、UTF-8に変換する必要があります。
*nix like computers
Generally, this may be done with the iconv command on Unix, Linux or a Mac.
iconv -f original_charset -t utf-8 originalfile > newfile
Windowsコンピュータ
For Windows, a free tool doesn't exist. However, the conversion may be done by using [Cygwin], a Linux-like environment for Windows, and excecuting the iconv command in that environment.
Example of a working sollution on Windows with [Cygwin]:
- Create a text file, named ToUtf8.txt
- Fill it with the following code
#!/bin/bash FROM=iso-8859-1 TO=UTF-8 ICONV="iconv -f $FROM -t $TO" # Convert find ToUTF/ -type f -name "*" | while read fn; do cp ${fn} ${fn}.bak $ICONV < ${fn}.bak > ${fn} rm ${fn}.bak done
Two things should be changed for your local situation:
- FROM is the originating encoding (the one your original files are in)
- ToUTF is the foldername where the files that need to be converted are in. This folder may contain subfolders. Make sure you have a backup!
- Start Cygwin.
- With the cd foldername, cd.., ls commands, go to the folder on your windows machine where the ToUtf8.txt-script and the ToUTF8 folder are in.
- Execute the script by typing sh ToUtf8.txt and your files will be converted.