Author Topic: Differn't languages  (Read 767 times)

Offline chesney-93

  • Level 7
  • *
  • Posts: 30
  • Reputation: +0/-0
    • View Profile
Differn't languages
« on: July 18, 2011, 03:59:54 AM »
Hello, two of my testers speak another language as well as English, they speak Icelandic.

There is about 6 special letters they use, when they do use them they don't appear as they should, instead  a � appears and the chat breaks in IE because of this. How do I add these letters so they work just like abc?

Thanks for reading!

Offline Chris

  • Game Owner
  • Level 35
  • *
  • Posts: 2,217
  • Reputation: +28/-1
    • View Profile
Re: Differn't languages
« Reply #1 on: July 18, 2011, 04:08:06 AM »
Charset (preferably UTF-8). Also, the user has to have a proper font installed in the system (so no matter what you do majority won't see Chinese language because they don't have it installed in the system, but it should not be a problem for latin languages).

Offline BlackScorp

  • Level 15
  • *
  • Posts: 123
  • Reputation: +6/-0
    • View Profile
    • Cruel Online
Re: Differn't languages
« Reply #2 on: July 18, 2011, 04:10:45 AM »
use in your HTML header

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

use in your php files

header("Content-Type: text/html; charset=utf-8");

use after database connection

mysql_query("SET NAMES 'utf8' ");

so you can display ALL languages

Offline chesney-93

  • Level 7
  • *
  • Posts: 30
  • Reputation: +0/-0
    • View Profile
Re: Differn't languages
« Reply #3 on: July 18, 2011, 04:17:41 AM »
Thank you guys, worked fine :-)

I also have another quick question, whole this topic is active I'll post here..

Because I've made this chat out of PHP/AJAX most im just using a normal <input for the text, after awhile when typing you see past messages show up (history for that input) how would I make it so its unique every time? I guess its adding a hash or something to it? :S

Offline Chris

  • Game Owner
  • Level 35
  • *
  • Posts: 2,217
  • Reputation: +28/-1
    • View Profile
Re: Differn't languages
« Reply #4 on: July 18, 2011, 05:07:08 AM »
use after database connection

mysql_query("SET NAMES 'utf8' ");
What's that and what it does? Never seen it...

Quote
so you can display ALL languages
The user still needs to have the font installed. Also proper locale (some languages are right to left instead left to right).

You also need proper locale installed on the server.

Generally, the problem becomes more escalated for multibyte languages (like strlen() and other functions not working). It's best to focus on latin only languages, much simplier than ALL languages and does not require rewriting of the code.

Offline BlackScorp

  • Level 15
  • *
  • Posts: 123
  • Reputation: +6/-0
    • View Profile
    • Cruel Online
Re: Differn't languages
« Reply #5 on: July 18, 2011, 05:17:41 AM »
use after database connection

mysql_query("SET NAMES 'utf8' ");
What's that and what it does? Never seen it...
this set ur Database to UTF8 so you can save chinese, arabian, russian words into your database

i had some names in my databse like this محمد ابو علي the funny think is that the browsers displays it from right to left automaticly


its simpler to manage latin characters only.. but its boring you know.. ;)

Offline Chris

  • Game Owner
  • Level 35
  • *
  • Posts: 2,217
  • Reputation: +28/-1
    • View Profile
Re: Differn't languages
« Reply #6 on: July 18, 2011, 05:29:13 AM »
What you mean by "this set ur Database to UTF8"? What it does with "CHAR(16)" field for example?


its simpler to manage latin characters only.. but its boring you know.. ;)
LOL, boring!? I'm doing it right now, it is not boring at all, rather challenging :) (don't forget about all these additional things like staff support, players communication, identification and representation of language used by fellow players, changes in social groups caused by language barriers; the display of different languages is merely a tiny part of it)

Offline chesney-93

  • Level 7
  • *
  • Posts: 30
  • Reputation: +0/-0
    • View Profile
Re: Differn't languages
« Reply #7 on: July 18, 2011, 05:30:23 AM »
What you mean by "this set ur Database to UTF8"? What it does with "CHAR(16)" field for example?


its simpler to manage latin characters only.. but its boring you know.. ;)
LOL, boring!? I'm doing it right now, it is not boring at all, rather challenging :) (don't forget about all these additional things like staff support, players communication, identification and representation of language used by fellow players, changes in social groups caused by language barriers; the display of different languages is merely a tiny part of it)

True, what are the chances of people using that languages signing up to a game in english?

Offline BlackScorp

  • Level 15
  • *
  • Posts: 123
  • Reputation: +6/-0
    • View Profile
    • Cruel Online
Re: Differn't languages
« Reply #8 on: July 18, 2011, 05:33:21 AM »
i got those names from my Facebook plugin.. you know Facebook API gives u the Names from users in the language which they using.. i got some chinese names in my DB as well. if you add facebook login in our game, a new user could have those characters i dont know if you can safe it in your database with latin ...

anyways iam using only UTF8 because everyone do this:P
BTW Chriz read this http://dev.mysql.com/doc/refman/5.0/en/charset.html

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal