Login
Username

Password



Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Navigation
Latest Addons
AD Gallery 25
SyntaxHighlighte... 45
Newsletters v4.03 103
Facebook Like Box 116
Newsletters v4.02 55
Metro 143
Facebook Connect 161
Shoutbox Panel 123
Redactor for PHP... 102
MI Floating Side... 105
Facebook Login/R... 146
Avatar Studio v2.03 175
Relationship Sta... 93
Sexual Orientati... 111
Fisherman 138
Popular Addons
iTheme2 5790
Arise 5779
User Control v1.23 4610
Event Calendar 4037
Photowidget panel 3879
Radio-Theme red2... 3345
Highslide Gallery 3306
CSS/JavaScript D... 3219
Facebook Connect... 2972
Dynamic Menu 2885
Slideshow Lightb... 2712
L-AMANT 2654
Enigma 2628
2Dark 2601
Black 2566
View Thread
Who is here? 1 guest(s)
 Print Thread
UTF-8
KFJ
Hi there,

Wasn't sure where I should post this, so it's posted here.

In ver. 6 it was possible at my site to write posts in the forum in both english, danish and thai, but after the update to ver. 7 it's only possible to write english and danish. When trying to post something which contain thai it change to something unreadable as following:

ตุลาคม ทำบุญออกพรรษา / ตักบาตรเทโวโรห

Is there any way to add thai too in ver. 7, so it again will be possible for my users to mix between the languages ?

I'm not sure if the problem is in the database where I using UTF-8 Unicode or in the way PHP-Fusion handle thai when posting something.

Hope someone can help me.
Thanks :-)

BTW: I just try here at this site too. It's not possible to use thai here too.
 
KFJ
Anyone please ?
 
KFJ
I try with a BUMP again.
 
hame
you have to change the CharSet, or get a Thai locale for your site.
win-874
tis-620
 
Digitanium
Just a stab in the dark but try replacing the stripinput function in maincore.php (lines 313-320) with:

Download source  Code
// Strip Input Function, prevents HTML in unwanted places
function stripinput($text) {
   if (QUOTES_GPC) $text = stripslashes($text);
   $search = array("\"", "'", "\\", '\"', "\'", "<", ">", "&nbsp;");
   $replace = array("&quot;", "&#39;", "&#92;", "&quot;", "&#39;", "&lt;", "&gt;", " ");
   $text = str_replace($search, $replace, $text);
   return $text;
}


 
KFJ
Digitanium wrote:
Just a stab in the dark but try replacing the stripinput function in maincore.php (lines 313-320) with:

Download source  Code
// Strip Input Function, prevents HTML in unwanted places
function stripinput($text) {
   if (QUOTES_GPC) $text = stripslashes($text);
   $search = array("\"", "'", "\\", '\"', "\'", "<", ">", "&nbsp;");
   $replace = array("&quot;", "&#39;", "&#92;", "&quot;", "&#39;", "&lt;", "&gt;", " ");
   $text = str_replace($search, $replace, $text);
   return $text;
}



Thanks Digi :-)

It seems like this solution helps. Now, it's both possible to write english, thai and danish with the speciel letters (æøåÆØÅ) again.

Thanks for your help :-)
 
archeens
for me it didnt helped

http://testswc3.w...
 
KFJ
archeens wrote:
for me it didnt helped

http://testswc3.w...

Sad to hear, but maybe we not had the same problem. At my site it was possible to read the old post written in thai in v6, just not possible to write new posts in thai with v7 before this solution from Digi.
 
emilife93
it working for me in v7.01.04

but when i upgrade to v7.01.05 and i put same code

Download source  Code
// Strip Input Function, prevents HTML in unwanted places
function stripinput($text) {
   if (QUOTES_GPC) $text = stripslashes($text);
   $search = array("\"", "'", "\\", '\"', "\'", "<", ">", "&nbsp;");
   $replace = array("&quot;", "'", "\", "&quot;", "'", "&lt;", "&gt;", " ");
   $text = str_replace($search, $replace, $text);
   return $text;
}


[/quote]

not working..

anyone can help?
Edited by emilife93 on 24-02-2011 17:03
 
emilife93
this thread dont have anymore support?....
 
Craig
Emilife93, please be patient a experienced user will help you at some point.

Please also remember the Rules regarding Double Posting.
 
http://www.fusiontube.co.uk/
emilife93
Fangree_Craig wrote:
Emilife93, please be patient a experienced user will help you at some point.

Please also remember the Rules regarding Double Posting.


ok....sory for mistake
 
Ankur
@EmiLife : Try changing these values in locale/Your_Locale/global.php :

$locale['charset'];
$locale['xml_lang'];
$locale['tinymce'];
$locale['phpmailer'];

Set the Charset to UTF-8 and the xml lang to your Language Code !
ankurthakur.co.cc/images/freelancer.png
 
http://ankurthakur.in/
emilife93
but when i use http://validator.... to validate check i get this error after change the Character Encoding

1. Error

Sorry, I am unable to validate this document because on line 370 it contained one or more bytes that I cannot interpret as utf-8 (in other words, the bytes found are not valid values in the specified Character Encoding). Please check both the content of the file and the character encoding indication.

The error was: utf8 "\x93" does not map to Unicode
Edited by emilife93 on 25-02-2011 14:51
 
jantom
Did you convert database to utf-8 before you changed global.php? Without this operation, Ankur's idea can't work.
...because the Prophet is only one...
 
http://jantom.info
emilife93
jantom wrote:
Did you convert database to utf-8 before you changed global.php? Without this operation, Ankur's idea can't work.


how to convect that ?
 
Ankur
jantom wrote:
Did you convert database to utf-8 before you changed global.php? Without this operation, Ankur's idea can't work.


But I am using Hindi Language with UTF-8 just by this method without changing the Database Character set, i.e Collation ! And My website is Validated except those HTML errors like on using onmouseout and onmousehover functions !
ankurthakur.co.cc/images/freelancer.png
 
http://ankurthakur.in/
emilife93
Ankur i Set the Charset to UTF-8 and the xml lang to Arabic Language Code ! and it working

but when i want to validator i get this error

Sorry, I am unable to validate this document because on line 480 it contained one or more bytes that I cannot interpret as utf-8 (in other words, the bytes found are not valid values in the specified Character Encoding). Please check both the content of the file and the character encoding indication.

The error was: utf8 "\x93" does not map to Unicode
 
Ankur
For better response, you should Post on Arabic Site : http://www.phpfus...m/news.php
ankurthakur.co.cc/images/freelancer.png
 
http://ankurthakur.in/
behrooz
hi , my site is persian .

please test :

$config['charset'] = "utf-8";

if not work test on this:

$locale['charset'] = "utf-8";
 
http://www.php-fusion-iran.com/
Jump to Forum:
Official Home of PHP-Fusion uses cookies. Some may already have been set. Read more about our Cookies here.
Please click the button I Consent Cookies to hide this bar and accept our cookies. If you continue to use the site with no action taken, we'll assume that you consent our cookies anyway.
Cookiebar Panel byVenue