feat: more charsets
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { ref, computed } from 'vue'
|
||||
import { codecs } from '@/utils/codecs.ts'
|
||||
import { EncodingConverter } from '@/utils/converter'
|
||||
import { useOsTheme, darkTheme } from 'naive-ui'
|
||||
@@ -28,7 +28,7 @@ const handleTextInput = (text: string) => {
|
||||
<n-input
|
||||
v-model:value="content"
|
||||
type="textarea"
|
||||
placeholder="请输入待转换的乱码文本"
|
||||
placeholder="请输入待恢复的乱码文本"
|
||||
clearable
|
||||
class="input"
|
||||
@input="handleTextInput"
|
||||
@@ -55,8 +55,6 @@ const handleTextInput = (text: string) => {
|
||||
|
||||
<style scoped lang="less">
|
||||
.container {
|
||||
// disable selection
|
||||
user-select: none;
|
||||
padding: 0.8rem;
|
||||
|
||||
.input {
|
||||
|
||||
@@ -4,44 +4,34 @@ export interface Codec {
|
||||
}
|
||||
|
||||
export const codecs: Codec[] = [
|
||||
{
|
||||
origin: 'GBK',
|
||||
target: 'UTF-8',
|
||||
},
|
||||
{
|
||||
origin: 'UTF-8',
|
||||
target: 'GBK',
|
||||
},
|
||||
{
|
||||
origin: 'GBK',
|
||||
target: 'ISO-8859-1',
|
||||
},
|
||||
{
|
||||
origin: 'GBK',
|
||||
target: 'BIG5',
|
||||
},
|
||||
{
|
||||
origin: 'GBK',
|
||||
target: 'UTF-16',
|
||||
},
|
||||
{
|
||||
origin: 'GBK',
|
||||
target: 'WINDOWS-1252',
|
||||
},
|
||||
{
|
||||
origin: 'UTF-8',
|
||||
target: 'ISO-8859-1',
|
||||
},
|
||||
{
|
||||
origin: 'UTF-8',
|
||||
target: 'BIG5',
|
||||
},
|
||||
{
|
||||
origin: 'UTF-8',
|
||||
target: 'UTF-16',
|
||||
},
|
||||
{
|
||||
origin: 'UTF-8',
|
||||
target: 'WINDOWS-1252',
|
||||
},
|
||||
{ origin: 'GBK', target: 'UTF-8' },
|
||||
{ origin: 'UTF-8', target: 'GBK' },
|
||||
{ origin: 'GBK', target: 'ISO-8859-1' },
|
||||
{ origin: 'GBK', target: 'BIG5' },
|
||||
{ origin: 'GBK', target: 'UTF-16' },
|
||||
{ origin: 'GBK', target: 'WINDOWS-1252' },
|
||||
{ origin: 'UTF-8', target: 'ISO-8859-1' },
|
||||
{ origin: 'UTF-8', target: 'BIG5' },
|
||||
{ origin: 'UTF-8', target: 'UTF-16' },
|
||||
{ origin: 'UTF-8', target: 'WINDOWS-1252' },
|
||||
{ origin: 'ISO-8859-1', target: 'UTF-8' },
|
||||
{ origin: 'ISO-8859-1', target: 'GBK' },
|
||||
{ origin: 'ISO-8859-1', target: 'BIG5' },
|
||||
{ origin: 'ISO-8859-1', target: 'UTF-16' },
|
||||
{ origin: 'ISO-8859-1', target: 'WINDOWS-1252' },
|
||||
{ origin: 'BIG5', target: 'UTF-8' },
|
||||
{ origin: 'BIG5', target: 'GBK' },
|
||||
{ origin: 'BIG5', target: 'ISO-8859-1' },
|
||||
{ origin: 'BIG5', target: 'UTF-16' },
|
||||
{ origin: 'BIG5', target: 'WINDOWS-1252' },
|
||||
{ origin: 'UTF-16', target: 'UTF-8' },
|
||||
{ origin: 'UTF-16', target: 'GBK' },
|
||||
{ origin: 'UTF-16', target: 'ISO-8859-1' },
|
||||
{ origin: 'UTF-16', target: 'BIG5' },
|
||||
{ origin: 'UTF-16', target: 'WINDOWS-1252' },
|
||||
{ origin: 'WINDOWS-1252', target: 'UTF-8' },
|
||||
{ origin: 'WINDOWS-1252', target: 'GBK' },
|
||||
{ origin: 'WINDOWS-1252', target: 'ISO-8859-1' },
|
||||
{ origin: 'WINDOWS-1252', target: 'BIG5' },
|
||||
{ origin: 'WINDOWS-1252', target: 'UTF-16' },
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user