Comments (8)
Everything is UTF-8. Pretty sure the problem is in PHP. I probably have to go with the iconv solution to fix this once and for all... Also see docker-library/php#240
from docker-osticket.
I used your second solution (mbstring) which worked fine until now. But I just got a mail with an utf-8 smiley and it truncated the message again.
from docker-osticket.
@cleiter I haven't tried emojis. What's your database charset?
from docker-osticket.
So i tried that (built my own docker image) and actually it did not improve things. I investigated further and saw that the correct type in mysql is not utf8 but utf8mb4.
I did a quick:
set sql_mode='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
alter table ost_thread_entry convert to character set utf8mb4 collate utf8mb4_unicode_ci;
(the first thing removes NO_ZERO_IN_DATE,NO_ZERO_DATE
otherwise it won't let me update the table)
and now I get ????
instead of an emoji but the text is not truncated anymore.
Still not a perfect solution but hopefully it helps someone.
from docker-osticket.
@cleiter utf8mb4
only affects 4-byte chars. Some emojis are 4-byte but most of them are 3-byte so they should be fine with utf8
. However to use utf8mb4
you need to:
- change default encoding in MySQL
- set default encoding in PHP when establishing database session
Otherwise, it won't work.
from docker-osticket.
I did change the default encoding to utf8mb4 but that doesn't affect existing tables, hence the alter table query.
How would I set the mysql encoding in PHP for osticket?
from docker-osticket.
@cleiter see https://stackoverflow.com/questions/16893035/using-utf8mb4-with-php-and-mysql
from docker-osticket.
OK thanks for your help :) I'll live with it as it is.
For reference, this was indeed a 4 byte smiley: 😊 (f09f 988a)
I would be super happy if the base image took care of all these encoding issues.
from docker-osticket.
Related Issues (20)
- Add MYSQL_PORT ENV Variable for install. HOT 1
- Mail send not work / code: 550, response: Invalid HELO string
- Timezone issue, causing lock issues HOT 1
- Update to v1.12.2 HOT 3
- Empty message body in 1.12 from outlook mail HOT 8
- Button add user doing nothing
- IMAP not working with Gmail settings
- Setting a static IP HOT 1
- API not working HOT 1
- CVE-2019-11043. Is it pacthed in 14.1 image ? HOT 1
- Pages are not translated when selecting a language pack HOT 1
- Cron not running at interval
- plugins not working when mounted as a volume HOT 2
- Show Real Visitor IP in Logs
- Empty ticket with certain content (often) HOT 3
- New Osticket version HOT 1
- Update to 1.15? HOT 8
- current linking is deprecated HOT 2
- setting up smtp woes HOT 2
- php 8 and osticket
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-osticket.