Url unicode on php - php

We are trying to add non-english chars to the site URL and inside text.
Currently php pages don't see Unicode 'get' arguments. The pages see the arguments as question marks, although we added <META http-equiv="Content-Type" content="text/html; charset=utf8">
See sample here.
Many thanks!

Output the strings trough utf8_encode();

Related

strange words appear when extract arabic text from pdf (PdfToText)

I have a problem when extract arabic text from pdf.
I use PdfToText library
The text appears in this figure (΋ΎϬϧϟ΍υϔΣϟ΍ΦϳέΎΗ ΏϟΎρϟ΍ϡϳΩϘΗΝΫϭϣϧ ΩϳϘϟ΍ϡϗέ)
How can i solve it ? i tried
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
but this did not solve my problem
English letters are part of basic ASCII char set so the output is usually without any problems however any other languages using various accents or even different letters, ie. Arabic, Azbuka, Greek, etc. uses letters out of the basic set.
Make sure all three sources are using same encoding:
all the PHP scripts generating the output
the HTML encoding meta tag
the output file as well
ad 1
Check your editor how it saves the PHP scripts to the file system. The way how to set it up differs from each editor
ad 2
Use HTML meta tag <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
ad 3
define the encoding to use UTF-8 for example: pdftotext -enc UTF-8 your.pdf. According to the documentation the PdfToText class generates UTF8-encoded text.

special characters replaced by question mark

My website is replacing an apostrophe (') with a question mark (?) while rendering the page.
See the deal - my kitchen cook's at
www.dealschintu.com
It is a simple HTML page written by me which does the following
Connect to MySQL database
Retrieve title
Display
Add this between the <head> tags of your website:
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
It should do the trick.
I got it working by changing the php file encoding from utf-8 to iso-8859-1

Html Special Chars PHP

fm API to get event discription, venue name etc...
Now sometimes I get special chars back like: ' é à , but they show up scrabled.
So how can I display them properly? Also with the descrioption I get html-tags back, but I do want to keep these.
Can someone help me out fot those both cases? The language I'm using is php
Thanks in advance
specify encoding in the header:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
...
encode string when handling the input
$str=utf8_encode($str);
if you are displaying the input back as-is, no encoding is required;
however, if the value is the content of an input or textarea, escape the html characters
<?php echo htmlspecialchars($str); ?>
For Latin characters, use
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
in your section.
you need to be sure about two things, the meta header referring to which enconding you will be using, and the encoding you are using for the text served.
If you are using a utf8 header just be sure to convert the text served to utf8, refer to functions for encoding conversion like : mb_convert_encoding

Two webpages displaying differently special spanish characters

I have a website where the web pages feed from the same database and I found that in two webpages that have same queries they interpretate the spanish special characters differently.
I cant really figure out what is wrong as I have stripped out the code which is interpreting the special spanish characters wrong and building it up from the scratch.
This one interpretes the characters well.
http://amragl.com/
This one interpretes the characters wrong.
http://amragl.com/menu.php
They both have the following
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
They both feed from the same database and use same queries.
Does anyone have any idea of how to fix this problem?
Thanks in advance.
--UPDATE-
PEASE SEE THE WORD "GAZPACH" or "AL LIM" to see the difference.
You have both
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
in the same file.
I suggest only using the utf-8 one.
Change iso-8859-1 to utf-8, should fix it.
The menu.php page is rendering with windows-1252 encoding, even tho it has iso-8859-1 set.
Are the menu.php contents coming from a database? If yes, which encoding is the database using?

Convert html entities into charactes problem

link
Im having trouble converting the html entites into html characters, (&# 8217;) i have tried using al the different php functions (html_entity_decode, htmlspecial characters etc...) None seem to be working, any ideas what function i need to use?
Thank you!
Your problem isn't that the characters are not decoded correctly, but that the browser is misinterpreting the decoded characters.
As the page is encoded using UTF-8, you need to specify that in the header:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

Categories