The utf-8 characters appear as ????

Started by zadnan, February 01, 2013, 02:19:27 PM

Previous topic - Next topic

zadnan

plz help
The utf-8 characters appear as" ????" only in category and board titles

Night09

Have you tried another browser or cleared the cache ? Ive just looked over some boards and see no sign of the issue.

zadnan

plz look at the board above infocenter
I have cleared the cache
the encoding of browser is utf-8

kat

Can't, if the forum's in Maintenance mode, as it is, now. :(

zadnan

plz have a look it is out of maintenance


Dzonny

Hello there.

As i can see only problem is with that one particular board. Can you just edit boards name in admin panel?

MrPhil

1. Don't bump in less than 24 hours. That's rude. Everyone here is a volunteer donating their time to help others.

2. Is this the first time you've used Urdu text in a category or board name? If so, how did you enter this text -- typed through the SMF Admin, or cut and pasted from some other source? Have you checked that all text fields in your database are UTF-8? Possibly category names and board names are still Latin-1?

zadnan

Quote from: Dzonny on February 03, 2013, 10:00:53 AM
Hello there.

As i can see only problem is with that one particular board. Can you just edit boards name in admin panel?
The problem is with category titles and board titles
titles in english appear ok
but titles in utf8 characters turn into ???

zadnan

Quote from: MrPhil on February 03, 2013, 10:14:35 AM
1. Don't bump in less than 24 hours. That's rude. Everyone here is a volunteer donating their time to help others.

2. Is this the first time you've used Urdu text in a category or board name? If so, how did you enter this text -- typed through the SMF Admin, or cut and pasted from some other source? Have you checked that all text fields in your database are UTF-8? Possibly category names and board names are still Latin-1?
This is the first time I typed a bump
I want the titles in urdu. I tried it over all  boards and categories and they turn in ????
so I created a new category and board to show you and keep the rest of forum in order for members
as you can see the posts are showing urdu characters in real forms
the problem is only with category titles and board titles and description
I converted the collation of boads table to utf8-general-ci

MrPhil

The text is real question marks ? and not UTF-8 "invalid characters", so they're coming out of the database as ?'s. Did you change the collation (encoding) of the tables before trying to type in Urdu text? Was the table still Latin-1 (latin1....)? If the text was already ? in the database, merely changing the field to UTF-8 won't fix the bad data. Check that the individual text fields for boards and categories are now UTF-8 -- changing the overall table might not change the existing fields within it (and they'll still be bad data). Are there any text fields that are still Latin-1, and if all fields are UTF-8, does it still produce ? instead of the desired characters?

zadnan

firstly I changed the collation to utf8_general_ci
then I created a new category in the admin panel
As I was told the new collation will work for new data only

zadnan

Quote from: MrPhil on February 03, 2013, 01:03:40 PM
The text is real question marks ? and not UTF-8 "invalid characters", so they're coming out of the database as ?'s. Did you change the collation (encoding) of the tables before trying to type in Urdu text? Was the table still Latin-1 (latin1....)? If the text was already ? in the database, merely changing the field to UTF-8 won't fix the bad data. Check that the individual text fields for boards and categories are now UTF-8 -- changing the overall table might not change the existing fields within it (and they'll still be bad data). Are there any text fields that are still Latin-1, and if all fields are UTF-8, does it still produce ? instead of the desired characters?

you are right I checked the structure of the row name and its collation is still Latin1_swedish_ci and I tried to change it though oprations but it remains same
I have no idea how to correct that

MrPhil

Quote from: zadnan on February 03, 2013, 01:14:51 PM
As I was told the new collation will work for new data only
Whoever told you that is wrong. When you change via phpMyAdmin the field's encoding/collation, it will change existing data to UTF-8 and it will apply to all data in that field, old and new. You old names were ASCII (Latin alphabet), so you won't notice any difference there when the fields become UTF-8. The row which is now showing "????????" I don't know if that will change at all, or if it will still be question marks. You'll probably have to edit it to change to Urdu text.

zadnan

Quote from: MrPhil on February 03, 2013, 05:11:04 PM
Quote from: zadnan on February 03, 2013, 01:14:51 PM
As I was told the new collation will work for new data only
Whoever told you that is wrong. When you change via phpMyAdmin the field's encoding/collation, it will change existing data to UTF-8 and it will apply to all data in that field, old and new. You old names were ASCII (Latin alphabet), so you won't notice any difference there when the fields become UTF-8. The row which is now showing "????????" I don't know if that will change at all, or if it will still be question marks. You'll probably have to edit it to change to Urdu text.
The agent of hosting company told me that change will affect the new enteries
I tried to change the field's encoding phpmyadmin but failed.
yesterday I edited the ???? but got an error message

can you please write the steps to change the encoding of required fields. May be I am wrong at some step
my hosting company is ixwebhosting


MrPhil

Have patience... I just got home from work.

Back up your database, and know how to restore it, in case any of this goes wrong for youl.

In phpMyAdmin, select a table and click on Structure tab
char and text fields should have an entry under 'collation' column
if it's not the right UTF-8 (e.g., still latin1...)
  click Change
  at the Collation pull down select an appropriate UTF-8 collation --
    probably utf8_general_ci or utf8_unicode_ci, unless utf8_persian_ci is useful to you
    you want consistent collation throughout your site, or you'll get error messages
  Save
do next text/char field

it might be a good idea to click on the Operations tab
go to the Table Options area
change the Collation to utf8_whatever_you're_using
click Go

do next table

This should change not only the field types, but existing data in the database. If it's ASCII (unaccented Latin alphabet) you won't notice any difference in that data. Text that is supposed to be Urdu might still be ????? or it might be converted into something.

zadnan

Mr Phill that solves my problem. I am grateful. thank you

Advertisement: