From f63603e6f311b55be605de773809d3f0ad0d57ed Mon Sep 17 00:00:00 2001 From: Nikolai Mavrenkov Date: Thu, 17 Feb 2022 23:38:47 +0300 Subject: [PATCH] Add support for custom encoding --- reader.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reader.ts b/reader.ts index 3004439..6a0dce3 100644 --- a/reader.ts +++ b/reader.ts @@ -6,6 +6,7 @@ export interface CommonCSVReaderOptions { columnSeparator: string | Uint8Array; lineSeparator: string | Uint8Array; quote: string | Uint8Array; + encoding?: string; } /** Options for CSVReader class */ @@ -107,7 +108,7 @@ export class CSVReader { private lastLineStartPos: number; constructor(reader: Deno.Reader, options?: Partial) { - this.decoder = new TextDecoder(); + this.decoder = new TextDecoder(options?.encoding); const mergedOptions: HiddenCSVReaderOptions = { ...defaultCSVReaderOptions, ...options,