Skip to content

Commit 5895fc0

Browse files
committed
Add replace test
1 parent b19ac8c commit 5895fc0

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

spec/html-to-utf8.spec.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,20 @@ describe('Encoding Converter', function() {
1515
it('guesses encoding even without meta tags or content type', function() {
1616
var input = loadExample('shiftjis.no.meta.html');
1717
var output = convert(input, 'text/html');
18-
expect(output).to.contain('日本語');
18+
expect(output).to.contain('次常用國字標準字體表');
1919
});
2020

2121
it('works for documents which already are UTF-8', function() {
2222
var input = loadExample('utf8.with.meta.html');
2323
var output = convert(input, 'text/html');
2424
expect(output).to.contain('日本語');
2525
});
26+
27+
it('Replace charset from the original input', function() {
28+
var input = loadExample('51242_54045.html');
29+
var output = convert(input, 'text/html');
30+
expect(output).to.contain('<meta http-equiv="Content-Type" content="text/html;utf-8" />');
31+
});
2632
});
2733

2834
function loadExample(name) {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<html>
22
<body>
3-
<h1>���{��</h1>
3+
<h1>次常用國字標準字體表</h1>
44
</body>
55
</html>

0 commit comments

Comments
 (0)