I have a Laravel 4.2 application which renders text to a PDF using dom2pdf (0.4) which works fine on the dev server but not live. It throws a 'iconv(): Detected an illegal character in input string' error on live which I believe is due to a long hyphen ( – ) in the text. Each system is using exactly the same data.
Is there a setting on the live server to work around this? All text is stored as utf8_unicode_ci in the MySQL database, and the html for the PDF has a utf-8 charset directive in the header. Both servers are running Apache/CentOS/Cpanel, dev server is running PHP Version 5.5.38 while live is 5.5.34.
Found the issue - it was because the mbstring PHP extension was not installed on the live server. If this is absent Laravel/dom2pdf falls back to its own mbstring implementation which was failing in my case.
Now mbstring is installed it works fine. Thanks to those who looked.
Related
I have a Spring App with Tomcat and MySql who runs with no problems in Windows, but when it's running on Linux server, special utf-8 characters (like spanish Ñ) are saved in Mysql table with the ? symbol.
If I change this character directly on the database, it's correctly showed by the app. It's when I save the object using the app when the Ñ is replaced by the ?
Other apps are running on the same server and they don't have this issue.
The data base has the UTF-8 charset/collation.
Can anybody help?
Thanks a million!
Make sure your Datasource URL includes UTF-8 character encoding!
Example:
jdbc:mysql://localhost:3306/databaseName?useUnicode=yes&characterEncoding=UTF-8
you have to put the right encoding in your properties file or in your DataSource URL. (characterEncoding=UTF-8)
I'm writing a new project that utilises MySQL , There is no problem with the app I'm working on, but when the app recives the output from my sql server it immediately rejects it as null. When accessing my SQL server on port 3306 I am getting strange garbled messages back as well as the short message 'packets out of order.' In my setup I have, MAMP, Docker, Apache server and PHP. I can access each service on its respective port just fine.
1) I have looked into this by running console in the browser which reports the text being incorrectly formatted to something that isn't utf-8
2) I have followed this guide
https://medium.com/#manish_demblani/breaking-out-from-the-mysql-character-set-hell-24c6a306e1e5 and the results that my sql server have churned out are as follows
enter image description here
My question is this. Why is MySQL set up in this strange fashion? Why is it presenting in CP850 /DOS/ Latin? Are there no defaults/config files to change or is it done through windows somewhere
It seems you somehow messed up the client configuration (connection string, [client]-section of your cnf file (on the system that you started the mysql console on), ...). It tells your server to send data in cp850. Not sure why you would get packets out of order, maybe you have an additional underlying problem (very old library maybe?), but I'd start there. It's unclear: did you follow the blog post and then had problems, or was that a solution attempt? In any case, try to focus your attention on the client. Try to undo changes you made. MySQL uses utf8 by default for a long time now. – Solarflare
I am using MYSQL and EF5(DB first) with connector/net 6.8.3.0. Everything works fine on my local machine but when I upload it to server it throws exception "Facet 'Precision' must not be specified for type 'datetime'".
Please let me know what is the reason.
Precision for datetime is added with MYSQL version 5.6 and I have generated the entities with latest MYSQL, so by default precision is added to the ssdl.
But on my server older version of MYSQL server was installed. This is the reason why it was throwing the exception.
Now with MYSQL server 5.6 we can have datetime(5) where 5 is the precision.
So we can have microsecond for datetime in MYSQL.
I too have been getting the "Facet 'Precision' must not be specified for type 'datetime'" error after publishing, but the cause of my problem differs from the OP's.
My Personal Solution
I have two independent servers: 'server1' with the EF5 web app, 'server2' with the database server1 references. Debugging the app on my local machine was no problem; but after I published to server1 the app kept crashing while trying to load. After much searching and testing I narrowed it down to either a configuration issue either with my application or MySQL. Finding this post (thank you kindly, user3275493, for answering your own question), I checked server2's MySQL config but alas it was already running MySQL Server 5.6. Just to be thorough (in reality this took me several days to realize), I decided to check MySQL Connecter and discovered that my local machine's was version 6.8.3 while server1's was version 5.6. After I updated Connector, I published my web app and it ran without flaw!
Simple Explanation
Not only will this error be caused by a MySQL version disagreement between Entity Framework and MySQL Server, but also between Entity Framework and MySQL Connector!
I have a DataNucleus JDO web application that exposes a MySQL database table as a web service. One of the table rows contains text in the Russian. When the web service returns that row, that text displays as ?'s.
Here is what I've tried so far:
I have confirmed that the data in the MySQL database table is in fact encoded correctly. When I view the data in MySQL Workbench, it displays correctly.
I tried writing a small MySQL client in Java that simply connects to the database and prints out the row. At first, I was receiving similar output (all ?'s). I then tried running the client with a JVM argument, -Dfile.encoding=UTF-8, and it worked.
I am running the web services in Tomcat. I tried adding -Dfile.encoding=UTF-8 to JAVA_OPTS in catalina.bat, and there was no change.
I have my JDBC Connection URL specified as a property in my pom.xml file, and it is referenced in the jdoconfig.xml. I tried appending ?useEncoding=true&characterEncoding=UTF-8 to the connection url, and I keep receiving the following NullPointerException error when I try to reach the web service:
java.lang.NullPointerException
org.datanucleus.api.rest.RestServlet.doGet(RestServlet.java:271)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
I'm all out of ideas now. I've been careful to make sure that I am viewing any output in a medium that supports UTF-8 encoding. I don't have a lot of experience with DataNucleus and the JDO API, so I'm wondering if I am missing something related to that.
Since a couple of months ago we are using in production environment a rubycass-server 1.0 validating against Active directory (Microsoft 2008 r2 server). We are using ruby 1.9.2p180, sinatra-1.1.3... We are having problems with Spanish and Catalan languages. If a user types ñ or ç … in the login or password field when he sends the form it produces an “internal server error” message. I have activated the debug mode in the config.yml options but when this error rises it does not appear any hint into the log file. A couple of days ago I tried the last version of rubycas 1.1.0 and this error (Internal server..) didn’t happen but if the login/password had any of this characters the validation always failed with the message “password incorrect”. I think it is an encoding error.
Has anybody found a solution to this problem?
Thanks in advance,
Solved. Problem was caused because we were using an old version of net-ldap (0.1.1). I updated this gem to the last version (0.3.1) and works like a charm.