Skip to content

Commit

Permalink
fix(routes/pdf/txt): limit charsets to poppler supported ones only
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs committed Mar 23, 2023
1 parent c43756d commit c056ddf
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/routes/pdf/txt/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,28 @@ const pdfToTxtPostSchema = {
S.string()
.default("UTF-8")
.description("Sets the encoding to use for text output")
.pattern(/^[-\w]+$/m)
// Encodings supported by Poppler
.enum([
"Big5",
"Big5ascii",
"EUC-CN",
"EUC-JP",
"GBK",
"ISO-2022-CN",
"ISO-2022-JP",
"ISO-2022-KR",
"ISO-8859-6",
"ISO-8859-7",
"ISO-8859-8",
"ISO-8859-9",
"KOI8-R",
"Latin2",
"Shift-JIS",
"TIS-620",
"UTF-8",
"UTF-16",
"Windows-1255",
])
)
.prop(
"ownerPassword",
Expand Down

0 comments on commit c056ddf

Please sign in to comment.