diff --git a/src/fix_charset b/src/fix_charset index 03ba008..03d70cc 100644 --- a/src/fix_charset +++ b/src/fix_charset @@ -16,6 +16,8 @@ fix_charset() { sed -i 's/\xc2\x92/\x27/g' "${file}" sed -i 's/\xc2\x85/\x2e\x2e\x2e/g' "${file}" sed -i 's/\xc2\x96/\x2d/g' "${file}" + sed -i 's/\xe9/\xc3\xa9/g' "${file}" + sed -i 's/\xc9/\xc3\x89/g' "${file}" done return 0 } diff --git a/src/import_images b/src/import_images index dcfc0c4..8e9e252 100644 --- a/src/import_images +++ b/src/import_images @@ -65,7 +65,7 @@ import_images() { for path in ${pathList[@]}; do case $(sed 's|.*\.||' <<< ${path}) in (jpg) echo "Copying cover image"; convert "${path}" "${GIT_DIR}/.import/${SOURCE}/${discidList}/img.png" ;; - (*) local DEST="${GIT_DIR}/.import/${SOURCE}/${discidList}/img.$(sed 's|.*\.||' <<< ${path})"; echo "Copying ${path} to ${DEST}"; cp --no-preserve=mode "${path}" "${DEST}" ;; + (cue|accurip|log|flac) local DEST="${GIT_DIR}/.import/${SOURCE}/${discidList}/img.$(sed 's|.*\.||' <<< ${path})"; echo "Copying ${path} to ${DEST}"; cp --no-preserve=mode "${path}" "${DEST}" ;; esac done } diff --git a/src/import_src b/src/import_src index 32bb4d2..2017f29 100644 --- a/src/import_src +++ b/src/import_src @@ -94,6 +94,17 @@ import_src() { local EXIT=$? [[ $? -eq 0 ]] || return 5 + # Convert tags and cue to utf-8 with bom + local txtExtensionsList=(tags cue) + for txtExtensions in ${txtExtensionsList[@]}; do + local pathList=("${GIT_DIR}/${IMAGEID}.${txtExtensions}" ${pathList[@]}) + done + fix_charset ${pathList[@]} + for path in ${pathList[@]}; do + iconv -t UTF-8//IGNORE "${path}" > "${path}.iconv" + mv "${path}.iconv" "${path}" + done + add_bom ${pathList[@]} # Remove metadata and move img.flac to GIT_DIR