Phantomjs changing text symbols - unicode

I am having an issue with PhantomJS (version 2.1.1/MAMP), it's garbling some symbols given when we are using with phantomjs.
I have the following UTF-8 character
---------------------------------------
ตัวละคร
---------------------------------------
When I tried this command,
phantomjs rasterize.js encoded.html 001.png
encoded.html contains the binary codes of the above word.
But the phantomjs command returns me the distorted text as below.
This is working as expected in my local MAMP server. But in server, I am getting the modified text.
I really appreciate any help or suggestions on what is the issue here.

Related

ANTLR4 no error messages while converting my grammar

the last few days/weeks I wrote ANTLR4 grammar and used it in my Javascript-React project.
While using the javascript runtime ( see here ), my console (powershell) always gave me an error message when my grammar was false or something was missing.
Now I'm out of town for a few weeks and had to install ANTLR4 + runtime on my laptop ( scroll down to WINDOWS for the tutorial I used ). This CLASSPATH stuff didn't worked for me, so I ignored it and .bat script didn't worked for me either, like when I installed it for the first time.
My file structure looks like this:
When I go into my powershell and switch to the right folder and hit
.\antlr-4.11.1-complete.jar -Dlanguage=JavaScript .\FunktionLexer.g4
everything works fine and I have my token for the parser. This is probably exact the same installation I had before going out of town.
But when I use wrong grammar and hit the command just nothing happens. Like nothing, no output on my command line what could be wrong. I tryed to add parameter like -Xlog, which gives me a log until the grammar crashes, but it doesn't really tell me where it crashed.
Thanks in advance!
Given the grammar (without lexer rules):
grammar FunktionLexer;
parse
: .*? EOF
;
I can generate a lexer and parser just fine by running:
java -jar antlr-4.11.1-complete.jar -Dlanguage=JavaScript FunktionLexer.g4
You might want to edit your question and clearly indicate how someone can reproduce what you describe.

incorrect coding, php unit, symfony

I have a problem with encoding characters when I'm trying to run test. I'm using Symfony 4 framework with package symfony/phpunit-bridge.
I'm running test by command like below:
php bin/phpunit tests/WhovianTest.php
The results looks like below:
As we can see there is a problem with encoding in test's results. I'm using windows 10 operating system and PHPStorm IDE.
How could I solve this problem?
I would be grateful for help.
A standard Windows 10 shell has some issues with the ANSI control characters that are used to display colors (they are quite recognisable with the ?[31; characters being displayed). There are some packages to add them, or you can just turn them off.
The phpunit docs suggest:
On Windows, use ANSICON or ConEmu
Alternatively, you can set colors="false" in the opening tag of your phpunit.xml, or as a command line parameter: --colors=never (try auto as well).

Wrong Character Encoding when exporting jasper as HTML stream

I'm using jasper library v. 6.2.2 with Oracle ADF 11, our servers are running Red Hat 6
I'm facing an issue with the special characters like French accent "€ è é ê û â"
when I export the report as a PDF everything works fine but on the same environment when exporting the report as HTML output using SimpleHtmlExporterOutput I get bad charachters like this "è, é..."
i tried changing the encoding to UTF8 and cp1252 when calling the class SimpleHtmlExporterOutput but still facing the same issue,
Thanks in advance
i changed the JAVA_OPTIONS on weblogic start params adding -Dfile.encoding=utf8 and forcing weblogic to start with UTF-8 and this solved my problem

wkhtmltopdf amazon linux won't encode emoji

I'm trying to generate a PDF via wkhtmltopdf in an Amazon Linux os, everything works fine, but when i try to use emoji on the HTML, the fonts break and the emoji is displayed as a black box.
Before deploying, i tried locally and it works, locally i have Ubuntu, so my guess is that i'm missing something (fonts?) in the production (the amazon linux instance) server. I tried to install Google Noto font but nothing happened. I'll attach 2 screens of the same HTML page, generated by the same command via wkhtmltopdf:
Local (Ubuntu):
Production (Amazon Linux):
As you can see, even the font below the broken emoji is not rendered as aspected, i'll add the command i use in both servers:
/my/path/to/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64 --lowquality 'file:///my/path/to/page-test-pdf.html' '/home/user/test.pdf'
Thanks for your time.
You can find a solution to a similar issue here basically twemoji.min.js replace the emoji with the corresponding image. Regarding the weird font spacing issue, you can use a monospaced font like roboto mono or something you like.
If you are running PHP 7.x, I have been having problems with the wkhtmltopdf extension within a dockerized image. We were trying to use font awesome and the text just did not render correctly. There were some compilation issues that caused this.
The problem was resolved when using the following binary https://github.com/madnight/docker-alpine-wkhtmltopdf
Hope this helps you forward.
EDIT: You will also have to have all fonts used installed as system fonts iirc otherwise wkhtmltopdf will refuse to work as it cannot find the font

DOMPDF Font Installer/Converter Not Working

I have DOMPDF working and running properly except that I can't install/convert the Arial Unicode font which my customer wants to use (with subsetting). When I go into the setup, authenticate, and try to install ARIALUNI.TTF I get the following PHP warnings:
Notice: Undefined index: family in C:\Program Files
(x86)\EasyPHP-5.3.9\www\mysite\pdfmaker\www\controller.php on line
21
Notice: Undefined index: file in C:\Program Files
(x86)\EasyPHP-5.3.9\www\mysite\pdfmaker\www\controller.php on line
22
Warning: Invalid argument supplied for foreach() in C:\Program Files
(x86)\EasyPHP-5.3.9\www\mysite\pdfmaker\www\controller.php on line
24
As you can see, that is running the utility from a WAMP. When I try to run the utility off the server itself, I can't login. It keeps asking for my username/password (though the same username/password work in the WAMP environment.)
Furthermore, I have found the web-based font converter here: http://eclecticgeek.com/dompdf/load_font.php. When I try to convert Arial Unicode there, it just loads for a bit, then the screen refreshes, and no dialog comes up for the .zip download, though this utility has worked for me for other fonts.
Does anyone have any idea why I'm having these problems and what a possible solution would be. Has anyone else had trouble generating the .ufm file for Arial Unicode? I'm running the latest version of DOMPDF.
Any help would be greatly appreciated.