Skip to content

Commit

Permalink
Add support for custom encoding (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
koluch authored Feb 23, 2022
1 parent 1f6bd61 commit b7e59f0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion reader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export interface CommonCSVReaderOptions {
columnSeparator: string | Uint8Array;
lineSeparator: string | Uint8Array;
quote: string | Uint8Array;
encoding?: string;
}

/** Options for CSVReader class */
Expand Down Expand Up @@ -107,7 +108,7 @@ export class CSVReader {
private lastLineStartPos: number;

constructor(reader: Deno.Reader, options?: Partial<CSVReaderOptions>) {
this.decoder = new TextDecoder();
this.decoder = new TextDecoder(options?.encoding);
const mergedOptions: HiddenCSVReaderOptions = {
...defaultCSVReaderOptions,
...options,
Expand Down

0 comments on commit b7e59f0

Please sign in to comment.