I can see Urdu language in DB but not on on home page - mysql-5.0

I have Urdu language not-for-profit news website. I had old database in MySQL4.0 but now the server has updated the database and it is now MySQL5.0.
My website was working well in earlier database but now text shows as question marks. But I can see the news with Urdu text in phpMyAdmin.
Can somebody tell me what is problem?
Thanks,
Kazmi

I assume you have your character sets set to utf-8 which I believe should work for urdu.
you may need to call this mysql statement before any query:
SET NAMES 'UTF-8'
more information about it at
http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html

Related

Characters with accents from a MySQL DB showing correctly on PHP pages but not on HTML

I have searched and searched and applied the obvious fixes but it seems I have another variant of the problem. I have PHP pages and these display what song is currently playing, what songs are coming next and last recently played on my web radio station, the info comes from mysql. The characters are displayed correctly on the php pages. This is where it gets tricky, I also have HTML pages which load 2 div's from a php page so that the coming up songs also display on those HTML pages but there that's when the accents characters don't show correctly, I have the correct meta tag in the header on those pages and have also used the .htaccess file trick (although I was not sure how important the location of the line in the file was so tried various places). I even opened my .htaccess in notepad++ to change the encoding to use UTF8 but no BOM. I even added a meta tag for UTF8 in the php page header and then the characters didn't work on php either, probably you're not supposed to. As you can see I spent a lot of time. What's interesting the characters display correctly on iPad, it's on the PC browsers it doesn't work. Maybe no one ever tried this before loading divs from php into HTML and have special characters too. Sounds interesting anyway and if anyone is interested in having a think that would be great but it's not a vital problem just a nice to have fix. The server side of my stuff is hosted on a hosting site
thanks

Convert URL Language

This question may be impractical and may be stupid, so please pardon me.
I want to change the LANGUAGE OF URL.
For example,
If the URL is
www.google.com
I just want to translate it to another Language(HERE 'MALAYALAM- An Southern Indian Language'). In Malayalam "Google" looks like "ഗൂഗിള്‍" . Means I just want to display in my address bar as www.ഗൂഗിള്‍.com instead of www.google.com.
Simply, how can I create default english URL to alternate language URL. PHP, Javascript, Jquery are preferred.
There is no technical solution to this. The only way to do it is to purchase the actual domain ഗൂഗിള്‍.com and to host a web site under it.
That domain name, however, is already taken and points to a Google search form.
See Wikipedia on Internationalized Domain Names

Unicode characters in Grails

I am trying to create an application in grails, its much like a blogging application. One of the requirement is that the application must support unicode, the user must be able to enter the blog using unicode character. I have changed the database to 'utf8_unicode_ci' and when i directly enter a unicode record to database, the text is displayed in unicode. The problem is when I enter the unicode characters from application, all I get is '?????' characters. How can I modify the application so that it supports unicode characters ?
Probably you didn't setup your database url correctly. Similar question here.
jdbc:mysql:///dbname?useUnicode=true&characterEncoding=utf-8

translate to multiple languages

I would like to get translation from one ( best - automatically detected) language to 4 different using google-translate. My idea is to wrote a html document which contain 4 frames - in one of them I can find text form and button. After click on it, Internet browser will send demand to google translate and show results in 4 frames.
If you want a self service, hosted service that does translations and content management for you check out Localize.js
This is going to be terribly translated. As someone that speaks English well, Russian poorly, and Spanish even more poorly, I can detect that these auto-translations never come out right.
My recommendation is to serve your page through a basic system that will allow you to respond to submitted form values. Pass in &LANG=two country iso code and then have your backend serve up the correct data.
Have someone that speaks both languages prepare the content for you. Then, whenever you are serving these pages, you can also conditionally adjust CSS to account for differences in format which come from difference in language length.
If you don't have those capabilities available, make 5 pages. One in English and the other 4 in the other languages. You will seriously seem retarded to anyone that speaks those languages well if you use an auto-translate. I think this is a bad idea for any kind of professional page, even if you can work out the technical issues.
-Brian J. Stinar-
Google has an API to its translate tool that will enable you to send it some text and receive back that text translated into any language you choose.
edit: This is now a paid service

How to set language of web page determined by visitor language

Can someone tell me how to set language of a web page on the knowledge of IP address of visitor so that he automatically gets page in his country's language. Of course if that language is implemented by web developer. Even better I sow some examples of automatic Google translation of the text.
So how to achieve that visitor from USA gets text on my page in English and visitor from France in French. All that translated by Google from some third original language.
Thanks a lot.
When it come to automatic language selection I'd go the mod_rewrite route if you're using Apache. It's easier to change in a production environment that touching application code. mod_rewrite grabs the "Accept-Language" out of the header then applies the rewrite rule.
RewriteCond %{HTTP:Accept-Language} ^fr [NC]
RewriteRule ^$ /fr/ [L,R=301]
You can stack the rewrite conditions and rules to work as a catch all language variations (fr, fr-ca, fr-fr, fr-mo, fr-ch all go to fr)
Checkout the official mod-rewrite documentation
good language example:
http://tech-blog.borychowski.com/index.php/2009/03/htaccess/redirect-according-to-browser-language-mod-rewrite-and-http_accept_language/
Once you push the user to the right general language (when none is defined in the URL) the application can set a session language, write links with the set lang. It's also good to allow people to change language on the fly since most users in bilingual locals (i.e. Quebec) work in more than one language. I've worked with French speaking programmers who prefer reading technical documents in English.
When it comes to Google translating text I'd be careful. If you're doing any e-commerce transaction your international customers (or local customers with international browser settings) may get incorrect or inaccurate product information, descriptions and "terms and conditions". If you don't save the exact Google translation text to your DB for every on the fly translation there is no way to track what the user has committed to in their language. Some non-translated legal copy may be in order.
I hope this helps.
Either:
Guess language from location (which you can get from their IP).
Look at the request header's "accept-language" value.
To see what's in your request header, have a look here: http://www.ericgiguere.com/tools/http-header-viewer.html
This is a bad idea from the offset.
Geolocating on IP address doesn't always work (and doesn't work if you use TOR)
Even if you get this right, what would you do for countries like Canada or Switzerland?
Automatic translation is ok, but it would be better to tell someone that you don't have the site in their language - they may then prefer to read it in a different language.

Resources