# Sony Bank CSV Converter

> **Status:** Active
> **Category:** Format Conversion
> **Language:** Python 3
> **Script file:** `convert.py`

## Purpose

Converts Sony Bank transaction history exports (`FutsuRireki.csv`) from Shift-JIS (CP932) encoding to UTF-8 so they can be opened correctly in modern tools such as Excel, Python, and text editors.

## Requirements

### Dependencies

Python standard library only — no third-party packages required.

```bash
# No pip install needed
python convert.py
```

## Input

| Item | Description | Example |
|------|-------------|---------|
| Source CSV | Sony Bank transaction history file in Shift-JIS/CP932 encoding | `FutsuRireki.csv` |
| Destination CSV (optional) | Output path; auto-generated if not specified | `output.csv` |

## Output

| Item | Description |
|------|-------------|
| UTF-8 CSV file | Re-encoded copy of the input file; `_utf8` is appended to the stem if no destination is specified (e.g. `FutsuRireki_utf8.csv`) |

The original file is never modified.

## Usage

```bash
# Use default filename — looks for FutsuRireki.csv in the same directory as the script
python convert.py

# Specify source file only (output will be FutsuRireki_utf8.csv)
python convert.py FutsuRireki.csv

# Specify both source and destination
python convert.py FutsuRireki.csv output.csv
```

## Examples

```bash
# Typical use: drag the exported file into the folder and run with no arguments
python convert.py
# → FutsuRireki_utf8.csv created alongside the original

# Explicit paths
python convert.py "FutsuRireki.csv" "FutsuRireki_utf8.csv"
# Converted: FutsuRireki.csv -> FutsuRireki_utf8.csv
```

## Notes

- The script decodes using `cp932` (Microsoft's superset of Shift-JIS used by Sony Bank exports). If decoding fails the error propagates — there is no silent dropping of bytes.
- A convenience text file `drag the FutsuRireki file - its ok if it doesnt look correct.txt` is included in the folder as a reminder that the raw CSV will appear garbled in a text editor before conversion — this is expected.
- No external dependencies means the script runs on any Python 3 installation with no setup.

## Related Scripts

- [CSV Encoding Converter](csvconvert.md) — general-purpose JIS-to-UTF-8 converter for arbitrary CSV files, uses `chardet` for auto-detection
