Tag Archives: utf-8
php screws up utf-8 charachters from mysql database using mysqli
I have some chinese characters (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' não funciona
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. De qualquer maneira, many rows have chinese… Continue lendo
Search tamil fonts in mysql and php
How to search tamil fonts and retrieve data from mysql and show the result using php?… Continue lendo
Code to Text (PHP, línguas)
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? Eu tentei utf8_decode… and doesn’t work.
I’m submitting the text with AJAX Continue lendo
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 Continue lendo
MongoDB [MongoRegex] pergunta: 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 (Windows) $results contains array of cities, but on server (Debian) $results is always = empty array. Continue lendo
Problemas UTF8 em um formulário de contato php
Aqui é a minha função de contato :
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 questões ao armazenar dados rss em uma tabela mysql
At the moment I’m reading rss feeds that may be encoded in any character type, utilização 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 Continue lendo
Substitua o caráter de uma  "com a sua entidade html ā
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);
…
Permitir apenas (Inglês & Árabe) no código UTF-8
Eu estou procurando um regex para mudar todos os não-Inglês e / ou árabe em sublinhado “_”
Atualmente tenho o seguinte código que funciona, mas eu acho que eu tenho a unicode errado
uma vez que permite variar chinês & outros idiomas… Continue lendo





