silverwolf-x/project / packages /next /src /server /lib /fix-mojibake.test.ts
silverwolf-x's picture
download
raw
531 Bytes
import { fixMojibake } from './fix-mojibake'
describe('Mojibake handling', () => {
const validValues = [
'hello-world',
'hello world',
encodeURIComponent('こんにちは'),
]
it.each(validValues)(
'should maintain value when encoding is correct $1',
(testValue) => {
expect(fixMojibake(testValue)).toBe(testValue)
}
)
it('should fix invalid encoding', () => {
expect(fixMojibake('/blog/ã\x81\x93ã\x82\x93ã\x81«ã\x81¡ã\x81¯')).toBe(
'/blog/こんにちは'
)
})
})

Xet Storage Details

Size:
531 Bytes
·
Xet hash:
4c3039e9722382ed46345fd051bfb814c27f33e13d2ba53e63bf7b85a585ce4c

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.