generated from xhofe/solid-lib
-
Notifications
You must be signed in to change notification settings - Fork 432
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: change encoding on text file (#110)
close AlistGo/alist#4131 --------- Co-authored-by: Andy Hsu <i@nn.ci>
- Loading branch information
1 parent
bae9d6e
commit 7be0048
Showing
13 changed files
with
247 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import { Box } from "@hope-ui/solid" | ||
import { SelectWrapper } from "./Base" | ||
|
||
export function EncodingSelect(props: { | ||
encoding: string | ||
setEncoding: (encoding: string) => void | ||
}) { | ||
const encodingLabels = [ | ||
"utf-8", | ||
"gbk", | ||
"gb18030", | ||
"ibm866", | ||
"iso-8859-2", | ||
"iso-8859-3", | ||
"iso-8859-4", | ||
"iso-8859-5", | ||
"iso-8859-6", | ||
"iso-8859-7", | ||
"iso-8859-8", | ||
"iso-8859-8i", | ||
"iso-8859-10", | ||
"iso-8859-13", | ||
"iso-8859-14", | ||
"iso-8859-15", | ||
"iso-8859-16", | ||
"koi8-r", | ||
"koi8-u", | ||
"macintosh", | ||
"windows-874", | ||
"windows-1250", | ||
"windows-1251", | ||
"windows-1252", | ||
"windows-1253", | ||
"windows-1254", | ||
"windows-1255", | ||
"windows-1256", | ||
"windows-1257", | ||
"windows-1258", | ||
"x-mac-cyrillic", | ||
"big5", | ||
"euc-jp", | ||
"iso-2022-jp", | ||
"shift_jis", | ||
"euc-kr", | ||
"iso-2022-kr", | ||
"utf-16be", | ||
"utf-16le", | ||
"x-user-defined", | ||
"iso-2022-cn", | ||
] | ||
return ( | ||
<Box | ||
pos="absolute" | ||
right={0} | ||
top={0} | ||
w="$36" | ||
opacity={0.15} | ||
_hover={{ | ||
opacity: 1, | ||
}} | ||
zIndex={1} | ||
> | ||
<SelectWrapper | ||
options={encodingLabels.map((label) => ({ | ||
label: label.toLocaleUpperCase(), | ||
value: label, | ||
}))} | ||
value={props.encoding} | ||
onChange={(v) => props.setEncoding(v)} | ||
/> | ||
</Box> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.