diary/Kojima/2009-08-06
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
[[diary/Kojima]]
・file-roller のデバッグ
日本語ファイル名が再生できない vlc とか、ディレクトリ選択...
gthumb とか、引数で日本語のファイル名を指定できない file-...
GNOME関係で文字コードがらみでトラブっているパッケージが散...
それぞれ、ざっとソースコードを眺めてみたけど、まずは一番...
ソースコードのあちこちに debug 用の printf をバラまく昔か...
用の gtk ベースな GUI アプリだと処理の流れと画面表示が同...
日本語のファイル名を指定した場合、どうやら fr-archive.c ...
で False が帰ってくるのが原因らしい。
copy_remote_file (FrArchive *archive,
const char *password)
{
XferData *xfer_data;
printf("archive_file name:%s\n", g_file_get_base...
printf("archive_file path:%s\n", g_file_get_path...
printf("archive_file name,conveted:%s\n", g_loca...
printf("archive_file uri:%s\n", g_file_get_uri(a...
if (! g_file_query_exists (archive->file, NULL)) {
printf("Here it is!!\n");
GError *error;
error = g_error_new (G_IO_ERROR, G_IO_ER...
fr_archive_copy_done (archive, FR_ACTION...
g_error_free (error);
return;
}
こんな風に printf 文を散りばめてビルドした file-roller で...
% ./work/usr/bin/file-roller ~/日本語_japanese.zip
archive_file name:�—ユœ�茯ž...
archive_file path:/home/kojima/�—ユœ...
archive_file name,conveted:日本語_japanese.zip
archive_file uri:file:///home/kojima/%E6%97%A5%E6%9C%AC%...
Here it is!
となり、g_file_query_exists() が Faluse になって、「"日本...
同じファイルを Japanese.zip にコピーしてやると、
% ./work/usr/bin/file-roller ~/Japanese.zip
archive_file name:Japanese.zip
archive_file path:/home/kojima/Japanese.zip
archive_file name,conveted:Japanese.zip
archive_file uri:file:///home/kojima/Japanese.zip
と、g_file_query_exists() のチェックもパスして、アーカイ...
結果的に見ると、g_file_get_basename() や g_file_get_path(...
実際のファイルシステム上のファイルへの結び付きがUTF-8化さ...
マニュアルとかを見てみると、g_file_get_basename() で得ら...
ということなので、 file-roller がどこかで余計な変換をして...
All GFiles have a basename (get with g_file_get_basename...
identify the file on the filesystem (relative to its par...
any particular charset encoding or even make any sense a...
you should use the display name that you can get by requ...
attribute with g_file_query_info(). This is guaranteed t...
But always store the real basename or the GFile to use t...
display name to the actual name.
次はファイル名を UTF-8 に変換しているあたりを中心に調べて...
終了行:
[[diary/Kojima]]
・file-roller のデバッグ
日本語ファイル名が再生できない vlc とか、ディレクトリ選択...
gthumb とか、引数で日本語のファイル名を指定できない file-...
GNOME関係で文字コードがらみでトラブっているパッケージが散...
それぞれ、ざっとソースコードを眺めてみたけど、まずは一番...
ソースコードのあちこちに debug 用の printf をバラまく昔か...
用の gtk ベースな GUI アプリだと処理の流れと画面表示が同...
日本語のファイル名を指定した場合、どうやら fr-archive.c ...
で False が帰ってくるのが原因らしい。
copy_remote_file (FrArchive *archive,
const char *password)
{
XferData *xfer_data;
printf("archive_file name:%s\n", g_file_get_base...
printf("archive_file path:%s\n", g_file_get_path...
printf("archive_file name,conveted:%s\n", g_loca...
printf("archive_file uri:%s\n", g_file_get_uri(a...
if (! g_file_query_exists (archive->file, NULL)) {
printf("Here it is!!\n");
GError *error;
error = g_error_new (G_IO_ERROR, G_IO_ER...
fr_archive_copy_done (archive, FR_ACTION...
g_error_free (error);
return;
}
こんな風に printf 文を散りばめてビルドした file-roller で...
% ./work/usr/bin/file-roller ~/日本語_japanese.zip
archive_file name:�—ユœ�茯ž...
archive_file path:/home/kojima/�—ユœ...
archive_file name,conveted:日本語_japanese.zip
archive_file uri:file:///home/kojima/%E6%97%A5%E6%9C%AC%...
Here it is!
となり、g_file_query_exists() が Faluse になって、「"日本...
同じファイルを Japanese.zip にコピーしてやると、
% ./work/usr/bin/file-roller ~/Japanese.zip
archive_file name:Japanese.zip
archive_file path:/home/kojima/Japanese.zip
archive_file name,conveted:Japanese.zip
archive_file uri:file:///home/kojima/Japanese.zip
と、g_file_query_exists() のチェックもパスして、アーカイ...
結果的に見ると、g_file_get_basename() や g_file_get_path(...
実際のファイルシステム上のファイルへの結び付きがUTF-8化さ...
マニュアルとかを見てみると、g_file_get_basename() で得ら...
ということなので、 file-roller がどこかで余計な変換をして...
All GFiles have a basename (get with g_file_get_basename...
identify the file on the filesystem (relative to its par...
any particular charset encoding or even make any sense a...
you should use the display name that you can get by requ...
attribute with g_file_query_info(). This is guaranteed t...
But always store the real basename or the GFile to use t...
display name to the actual name.
次はファイル名を UTF-8 に変換しているあたりを中心に調べて...
ページ名: