Phantomjs text symbols not displayed with html to pdf - centos

Hi I'm running phantomjs on centOS 6 and special text symbols are not displayed in the pdf output, such as ⊥ - up tack (u+22a5) and ∩ - intersection (u+2229). Phantomjs on my old server worked fine. Do I need to install special fonts on the new server?

I found my answer by adding this:
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
My reference:
https://jsreport.net/blog/national-characters-in-phantom-pdf-recipe

Related

Set Chinese Fonts on HTML Emails (Outlook)

Is it possible to set a Chinese font on HTML Emails for Outlook 2013? I want to be able to change the style of the punctuation for commas and full stop.
So it'll look similar to the Microsoft JhengHei font instead of the SimSun font.
There are a couple things you can do to make sure Chinese characters display in web or email. First, some code for the email <head>:
<!DOCTYPE html>
<!--
Set HTML language attribute
zh = Chinese
zh-Hans = Chinese (Simplified)
zh-Hant = Chinese (Traditional)
-->
<html lang="zh" xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<!--
utf-8 works for most cases, including Chinese
-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
</html>
You must make sure that you save your document in UTF-8 format and upload the document to your server or ESP so that the format is preserved. Some editors won't do or aren't configured like this by default, so you may need to check on that.
But ultimately these fonts won't display if a user doesn't have them installed on their local system. Specifying an appropriate font stack behind Microsoft JhengHei will help ensure that something shows up.

Why does not browser support unicode characters typed in netbeans?

I am using netbeans 7.4 for PHP programming. I have a web form and need to insert a non-English language (Sinhalese)to the interface. I have installed various fonts of this language in my PC and my browser (firefox) renders these fonts properly, because I have viewed local websites using the browser.
Netbeans shows this font as squares and when I run it in the browser something like this කොහොමà·à¶ºà·’is displayed. (Not squares). What is the reason for this? I really do not want to netbeans to show those characters. If the browser can render them, that would be enough.
Answering my own question :)
If you want to display unicode in your browser, you have to include below meta under <head> tag of your html part. Otherwise it won't render non-English content. This worked for me, but netbeans still shows squares for non-English context. I don't mind it since I am using non-english only for user interfaces
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
Hope this will help a future reader

Encoding UTF-8 for Czech chars

I want to ask you, as a beginner, what basic settings for the document encoding are you doing with UTF-8?
An example how I do it below and am asking about repair if something is wrong. I want to rely on all devices in different browsers with different user settings will render the text as it should, so I will do the following:
I use Notepad ++ , first in the Format tab choose "change the encoding to UTF-8 (if its already not)";
Because I use <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> mostly or . <!DOCTYPE html>, then select the correct attribute for the meta tag in the head, so either <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> , respectively . <meta charset="UTF-8" />
I'm concerned mainly about the Czech characters
Am I right or isn´t it that simple if I expect cooperation between HTML, PHP or JS, maybe MySQL?
Thank you for your answers and sorry for incomplete English.
If you read text from a Database make sure that it is set to utf8 and that the columns are as well. Then you can use SET NAMES UTF8 to make sure the connection encoding is utf8 as well. Just make it your first query to the databse.

Name of uploaded files in unicode

I´m having problems getting correct names of files uploaded to a NancyFx web.
I´m Spanish and we have no common characters like
ñ á é í ó ú... in uppercase and many more.
When I pick the file already uploaded from this.Request.Files.FirstOrDefault().Name then the names are always bad encoded.
I tried a lot of transformations with no success.
Any suggestions are highly appreciated.
Does your HTML page contain a
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
within the <HEAD> element?
I have same experience with Korean file name.
And after some more googling, I found this nancyfx github issue: https://github.com/NancyFx/Nancy/issues/1850
It's fixed bug. (but I am using nancy 0.x version, so it did not helped me.)

why "»" shows as a question mark("?") in my page?

Is there any restrictions for it to show normally?
Sounds like an encoding problem. For special characters like that, I prefer to use HTML entities. In this case, try »
After my experience, a question mark usually replaces undecodable special characters when you encode your special characters with utf8, because web browsers by default decode the web page using iso-latin1. You can/should explicitely declare the encoding of your web page using the following directive:
<?xml version="1.0" encoding="UTF-8" ?>
for xhtml, or
<meta http-equiv="Content-Type" content="text/html"; charset="utf-8">
(inside the element), for HTML.
Regard this post as a supplement, because I guess that using the xml/html entities like » or » mentioned above are the better way to go.
You can also use »
If your Apache server is configured with...
AddDefaultCharset UTF-8
...in the httpd.conf file (which, strangely, was the default on my server), then Content-Type specs in the .html files (e.g., <meta http-equiv=Content-Type content="text/html; charset=windows-1252">) will be ignored, causing character codes above 127 to be interpreted incorrectly.
Comment out the AddDefaultCharset line and restart Apache.