public void writeToFile(String content) {
        try {
            stream.write(replaceScandinavians(content).getBytes());
        } catch (IOException e) {
            System.out.println("Error: " + e.getMessage());
        }
    }