diff --git a/taglib-1.4_wchar.diff b/taglib-1.4_wchar.diff new file mode 100644 index 0000000..b84a614 --- /dev/null +++ b/taglib-1.4_wchar.diff @@ -0,0 +1,31 @@ +diff -ruN taglib-1.4.org/taglib/toolkit/tstring.cpp taglib-1.4/taglib/toolkit/tstring.cpp +--- taglib-1.4.org/taglib/toolkit/tstring.cpp 2005-07-26 06:31:15.000000000 +0900 ++++ taglib-1.4/taglib/toolkit/tstring.cpp 2006-05-26 12:02:55.000000000 +0900 +@@ -202,12 +202,22 @@ + s.resize(d->data.size()); + + if(!unicode) { +- std::string::iterator targetIt = s.begin(); +- for(wstring::const_iterator it = d->data.begin(); it != d->data.end(); it++) { +- *targetIt = char(*it); +- ++targetIt; ++ bool cjk = false; ++ //pre-scan: is there any cjk unicode character? if so, convert the string into utf-8. ++ for(unsigned int i=0; i< d->data.size(); i++){ ++ if(d->data[i] > 0xff){ ++ cjk = true; ++ break; ++ } ++ } ++ if(!cjk){ ++ std::string::iterator targetIt = s.begin(); ++ for(wstring::const_iterator it = d->data.begin(); it != d->data.end(); it++) { ++ *targetIt = char(*it); ++ ++targetIt; ++ } ++ return s; + } +- return s; + } + + const int outputBufferSize = d->data.size() * 3 + 1; diff --git a/taglib.spec b/taglib.spec index 6ba97d2..7850ebc 100644 --- a/taglib.spec +++ b/taglib.spec @@ -1,6 +1,6 @@ Name: taglib Version: 1.4 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Audio Meta-Data Library Group: System Environment/Libraries @@ -8,6 +8,7 @@ License: LGPL URL: http://ktown.kde.org/~wheeler/taglib/ Source: http://developer.kde.org/~wheeler/files/src/taglib-1.4.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Patch0: http://foetida.jaist.ac.jp:37565/~yaz/diary/2006/07/taglib-1.4_wchar.diff Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig @@ -31,6 +32,7 @@ Development tools for taglib %prep %setup -q +%patch0 -p1 -b .wchar %build @@ -76,6 +78,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Thu Dec 14 2006 Aurelien Bompard 1.4-5 +- add patch for multi-language support + * Thu Sep 14 2006 Aurelien Bompard 1.4-4 - have the devel package require pkgconfig (#206443)