#!/bin/bash

# Define function to convert file to UTF-8 encoding using NKF
convert_to_utf8() {
    nkf -w --overwrite "$1"
}

# Change to directory containing HTML files
cd /mnt/storage/site-warcs/extracted/warc-extractor-test-extraction/data/geocities.co.jp

# Find all HTML files in directory and its subdirectories
find . -type f -name '*.html' | while read file; do
    # Convert file to UTF-8 encoding using NKF
    convert_to_utf8 "$file"
done
