UTF – 8 character support ( Chinese character support )
See original GitHub issueHi , I have requirement to support utf-8 character. I have tried to with Chinese but it did not work . Below is my code , suggest how to support .
index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.min.js" type="text/javascript"></script>
<script src="pdf-lib/dist/jspdf.debug.js"></script>
</head>
<body>
<div id="content">
<h1>The title goes here 正體字/繁體字</h1>
<p>The pararaph goes here</p>
</div><div id="page">
</div>
<button id="submit">Export to PDF</button>
<script src="script2.js"></script>
</body>
</html>
script2.js
var doc = new jsPDF();
var specialElementHandlers = {
'#editor': function (element, renderer) {
return true;
}
};
$('#submit').click(function () {
doc.fromHTML($('#content').html(), 15, 15, {
'width': 190,
'elementHandlers': specialElementHandlers
});
doc.save('sample-page.pdf');
});
Issue Analytics
- State:
- Created 8 years ago
- Comments:9
Top Results From Across the Web
Should I change from UTF-8 to UTF-16 to accommodate ...
UTF -8 and UTF-16 encode exactly the same set of characters. It's not that UTF-8 doesn't cover Chinese characters and UTF-16 does. UTF-16...
Read more >What is UTF-8? UTF-8 Character Encoding Tutorial
UTF -8 is a character encoding system. It lets you represent characters as ASCII text, while still allowing for international characters, ...
Read more >What languages does the character encoding UTF-8 support?
chinese is 100% supported. with complications. there are multiple chinese character sets for digital representation, and there are multiple ways ...
Read more >Are Chinese characters UTF 8? - Quora
Yes, you can represent them each with 4 bytes in UTF-8. However, it's very inefficient if the text consists entirely or mostly of...
Read more >Unicode/UTF-8 characters (Chinese characters, Barcodes, etc ...
Unicode /UTF-8 characters (Chinese characters, Barcodes, etc.) and CSV files ... Simple CSV files do not support Unicode/UTF-8 characters. This is a limitation...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Duplicate of #12