Tag Archives: utf-8
php screws up utf-8 charachters from mysql database using mysqli
I have some chinese characters (e.g. 中文(简体)) stored in a mysql database with content type utf8_bin.
I am pulling from the database with this code:
if($stmt = $mysqli->prepare("SELECT c_color FROM colors")){
$stmt->execute();
$stmt->bind_result($ccolor);
$stmt->store_result();
if($stmt->fetch()){
//$ccolor is filled with …
php display chinese characters SET NAMES 'utf8' non funziona
I’m trying to work with a database that I got but I can’t display chinese characters in it. The database was actually a MS Access file first, that I converted into mysql with a program. Comunque, many rows have chinese… Continua a leggere
Search tamil fonts in mysql and php
How to search tamil fonts and retrieve data from mysql and show the result using php?… Continua a leggere
Code to Text (PHP, lingue)
When I submit a post with AJAX that is not in English, I will get something similar to %u4F60%u662F%u5982%u4F55%u505A%uFF1F
What can I do to fix this in PHP? Ho provato utf8_decode… and doesn’t work.
I’m submitting the text with AJAX Continua a leggere
Why is this preg_match() code returning true in PHP CLI and false in Apache
I’m trying to validate some Arabic text encoded in UTF-8 and running into unexpected results in PHP 5.3.8. Running the following snippet through CLI returns true and false through Apache.
var_dump(preg_match("/[[:alnum:]]/i", "عايش لهدف"));
…
I have mbstring.func_overload set to 7 e Continua a leggere
MongoDB [MongoRegex] interrogare: working on localhost but empty results on server
I use MongoRegex to find cities starting with first characters of users’s input:
$search = new MongoRegex('/^'.$_POST['search'].'/');
$results = iterator_to_array( $mongodb->cities->find(array('_id'=>$search)) );
…
On localhost (Finestre) $results contains array of cities, but on server (Debian) $results is always = empty array. Continua a leggere
Problemi UTF8 in un modulo di contatto php
Here is my contact function :
public static function contact_anon()
{
$form = new Form('contact_anon');
$form->field('email', 'text', array
(
'max_length' => 45,
'valid_email' => true
));
$form->field('message', 'textarea', array
(
'max_length' => 400,
'min_length' => 25
));
if($data = $form->validate())
…
Charset problemi quando rss memorizzazione dei dati in una tabella mysql
At the moment I’m reading rss feeds that may be encoded in any character type, utilizzando simplexml_load_file();…
These feeds are then looped through in php and some parts are inserted into a mysql database that is utf8 with all tables Continua a leggere
Replace character Ä with it's html entity ā
I’m having a really hard time trying to replace a certain character with it’s entity equivalent. I tried to str_replace the character “ā” but it just wont work! I can’t see why. The code I use:
$content = str_replace('ā', 'ā',$content);
…
Allow only (Inglese & Arabic) in UTF-8 code
I am looking for a regex to change all non-english and/or arabic into underscore “_”
Currently I have the following code which works but I think that I’ve got the wrong unicode
range as it allows Chinese & other languages… Continua a leggere





