Skip to content
Advertisement

Tag: encoding

PHPMailer changing Content-transfer-encoding

I’m developing a program which uses PHPMailer. I want to change “Content-transfer-encoding” in header of email. Here is my eml format email header sample. BUT I want to change “quoted-printable” to “base64” Is there any solution change encoding?? Answer You could try reading the documentation, or looking at the source code. In short, do this: But I wouldn’t advise doing

preg_match accented characters

I have an issue using preg_match with php. I want my users to fill the Name field with only valid characters. Ex: no numbers or special chars. My site will eventually be bilingual but most of my visitors are french Canadians I prefer utf-8 for my encoding. So at the top of my document i have this tag : I

Encoding for SMS messages

I’m currently building an application which uses Nexmo to send SMS messages to users. But I’m experiencing some problems with the encoding of messages. Probably worth metioning; I’m using the prawnsalad/Nexmo-PHP-lib library to connect with their API. A simple text messages of 160 characters is divided into 3 separate messages. According to the Nexmo support, this is caused by the

PHP, convert UTF-8 to ASCII 8-bit

I’m trying to convert a string from UTF-8 to ASCII 8-bit by using the iconv function. The string is meant to be imported into an accounting software (some basic instructions parsed accordingly to SIE standards). What I’m running now: This works for accounting software #1, but software #2 complains about the encoding. Specified encoding by the standard is: IBM PC

How can I detect a malformed UTF-8 string in PHP?

The iconv function sometimes gives me an error: Is there a way to detect that there are illegal characters in a UTF-8 string before sending data to inconv()? Answer First, note that it is not possible to detect whether text belongs to a specific undesired encoding. You can only check whether a string is valid in a given encoding. You

How to handle user input of invalid UTF-8 characters

I’m looking for a general strategy/advice on how to handle invalid UTF-8 input from users. Even though my web application uses UTF-8, somehow some users enter invalid characters. This causes errors in PHP’s json_encode() and overall seems like a bad idea to have around. W3C I18N FAQ: Multilingual Forms says “If non-UTF-8 data is received, an error message should be

Advertisement