Skip to content
Advertisement

Tag: utf-8

When do I need u-modifier in PHP regex?

I know, that PHP PCRE functions treat strings as byte sequences, so many sites suggest to use /u modifier for handling input and regex as UTF-8. But, do I really need this always? My tests show, that this flag makes no difference, when I don’t use escape sequences or dot or something like this. For example preg_match(‘/^[da-f]{40}$/’, $string); to check

Convert � � to Emoji in HTML using PHP

We have a bunch of surrogate pair (or 2-byte utf8?) characters such as �� which is the prayer hands emojis stored as UTF8 as 2 characters. When rendered in a browser this string renders as two ?? example: I need to convert those to the hands emjoi using php but I simply cannot find a combination of iconv, utf8_decode, html_entity_decode

Tcpdf issue with display hindi language font

I am using Tcpdf PHP library to generate PDF. I got issue with display in Hindi language fonts in generated PDF. I have all things like fonts characters standards etc.. properly but my generated PDF contains ?????? instead of Hindi fonts. please have a look I have included my code here. please help to solve my issue. Answer Try this:

� character from ldap

i am getting some strange characters form ldap server when i search some user info.if value contains turkish characters like ‘ç’ it replaces to ‘�’.in this situatian i convert string to utf-8 than str_replace to fix it.My function is that; But sometimes that causes some problem , so i have to detect if string contains ‘�’ character to fix it.strpos

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

Advertisement