BTC USD 42,566.6 Gold USD 1,777.80
Time now: Jun 1, 12:00 AM

non-ASCII character

anipo

Active+ Member
Joined
May 15, 2008
Messages
4,887
Reaction score
126
Points
33
salam,
sape tau cmner nak enable kan speacial character kat phpbb..??:(( atau setting dr host..??

contoh,
Code:
Cari•Gold

problem slps post kat phpbb forum, jd mcm ni
Code:
Cariɨold

:(:(
 
Sponsored Post

anipo

Active+ Member
Joined
May 15, 2008
Messages
4,887
Reaction score
126
Points
33
contoh error lain..
kat carigold
Code:
[SIZE="5"]CG™[/SIZE]

kat phpbb forum jd cmni
Code:
[SIZE="4"]CGѼ[/SIZE]

anip tgk x sume phpbb forum problem cmni...:-?
 

DDos

Legendary Member
Joined
Nov 7, 2007
Messages
14,111
Reaction score
690
Points
166
aku ada jumpa problem mungkin leh bantu ko

Special Characters Problem

I'm making a custom form to create a new topic in a determined forum, actually it is working perfectly.
My problem is with special characters like "´`äã" when i post something with this characters the string that contains this characters become null..

I tried this example but still returning a null..


$_REQUEST['multibyte_string'] = 'Käse';

// normalize multibyte strings
echo utf8_normalize_nfc(request_var('multibyte_string', '', true));
// ASCII strings do not need to be normalized
echo request_var('multibyte_string', '');


If i change
$_REQUEST['multibyte_string'] = 'Käse';
removing "ä" it works

MY Ccode


<?php
define('IN_PHPBB', true);
$phpbb_root_path = '../forum/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);

include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();

// Get the vars from the template
$uname = utf8_normalize_nfc(request_var('name','empty'));
$umail = utf8_normalize_nfc(request_var('email','empty'));
$umsn = utf8_normalize_nfc(request_var('msn','empty'));
$uage = utf8_normalize_nfc(request_var('age','empty'));
$realm = utf8_normalize_nfc(request_var('char_realm','empty'));
$cname = utf8_normalize_nfc(request_var('char_name','empty'));
$level = utf8_normalize_nfc(request_var('char_level','empty'));
$race = utf8_normalize_nfc(request_var('char_race','empty'));
$class = utf8_normalize_nfc(request_var('char_class','empty'));
$talent = utf8_normalize_nfc(request_var('talent_spec','empty'));
$prof = utf8_normalize_nfc(request_var('professions','empty'));
$sreen = utf8_normalize_nfc(request_var('screenshot','empty'));
$gsite = utf8_normalize_nfc(request_var('guildsite','empty'));
$armory = utf8_normalize_nfc(request_var('char_armory','empty'));
$expdesc = utf8_normalize_nfc(request_var('exp_desc','empty'));
$guildsdesc = utf8_normalize_nfc(request_var('guilds_desc','empty'));
$timedesc = utf8_normalize_nfc(request_var('time_desc','empty'));
$respecdesc = utf8_normalize_nfc(request_var('respec_desc','empty'));
$aftherdesc = utf8_normalize_nfc(request_var('afther_desc','empty'));
$friendsdesc = utf8_normalize_nfc(request_var('friends_desc','empty'));

// Set the body contents
$my_message = "Personal Information" . "\n" . "Name: " . $uname . "\n" . "E-Mail: " . $umail . "\n" . "MSN: " . $umsn ."\n" . "Age: " . $uage . "\n" . "\n" . "Character Information". "\n" . "Realm: " . $realm . "\n" . "Name: " . $cname . "\n" . "Level: " . $level . "\n" . "Race: " .$race . "\n" . "Class: " . $class . "\n" . "Spec: " . $talent . "\n" . "Professions: " . $prof . "\n" . "UI Screenshot: " . $sreen . "\n" . "Current Guild Website: " . $gsite . "\n" . "WoWArmory Link: " . $armory . "\n" . "\n" . "General Information" . "\n" . "What have you raided?\n" . $expdesc . "\n" . "What guilds have you been in, and why did you leave?\n" . $guildsdesc . "\n" . "What are the times you are available for raids?\n" . $timedesc . "\n" . "Are you willing to spec in order to help guild progress?\n" . $respecdesc . "\n" . "What are you hoping to get in Aftermath?\n" . $aftherdesc . "\n" . "Is there anyone in the guild that knows you allready and you might want to refer to?\n" . $friendsdesc . "\n" . "\n";


// Set the subject
$my_subject = (preg_replace("(\[color=(.+?)\](.+?)\[\/color\])is","$2",$class) . " Application " . $cname);

// Process the text
$subject = utf8_normalize_nfc($my_subject);
$message = utf8_normalize_nfc($my_message);

if (isset($_POST['Submit']))
{
// Generate the code to insert the post
// variables to hold the parameters for submit_post
$poll = $uid = $bitfield = $options = '';

generate_text_for_storage($subject, $uid, $bitfield, $options, false, false, false);
generate_text_for_storage($message, $uid, $bitfield, $options, true, true, true);

$data = array(
'forum_id' => 2,
'icon_id' => false,

'enable_bbcode' => true,
'enable_smilies' => true,
'enable_urls' => true,
'enable_sig' => true,

'message' => $message,
'message_md5' => md5($message),

'bbcode_bitfield' => $bitfield,
'bbcode_uid' => $uid,

'post_edit_locked' => 0,
'topic_title' => $subject,
'notify_set' => false,
'notify' => false,
'post_time' => 0,
'forum_name' => '',
'enable_indexing' => true,
);
submit_post('post', $subject, $cname, POST_NORMAL, $poll, $data);
}
?>


Thx

try this

you're missing the third parameter in request_var() which tells phpBB it will be a multibyte string, so, change your lines like this:

$uname = utf8_normalize_nfc(request_var('name','empty'));


to

$uname = utf8_normalize_nfc(request_var('name','empty', true));



Also these two lines are rendundant and will not affect anything:
// Process the text
$subject = utf8_normalize_nfc($my_subject);
$message = utf8_normalize_nfc($my_message);
 

anipo

Active+ Member
Joined
May 15, 2008
Messages
4,887
Reaction score
126
Points
33
erk ddos..
sume tu nak edit kat mana..??
 

anipo

Active+ Member
Joined
May 15, 2008
Messages
4,887
Reaction score
126
Points
33
yg ni semua berkaitan ngan phpmyadmin, database dan segalanya, kalu ko nak yg details leh usha sini, aku nak cite pun susah

http://www.phpbb.com/community/viewtopic.php?f=1&t=583955&start=30

http://www.phpbb.com/community/viewtopic.php?f=71&t=1287615

p/s: sebab tu aku tak suka phpbb ni, tambah2 yg version 3, byk bugs lagi walaupun dah relese gold version , so gunalah vbulletin 3.7.4 :)

cite la cmner nak edit..
kalo 2 link tu je yg ko paste, mmg anip da masuk awal2 da..
tp pe dorang discuss tu belit2 la..:((anip ikut step2 pon x jd..

sbb tu tnye sini mne tau ada org yg leh explain detail..
 

DDos

Legendary Member
Joined
Nov 7, 2007
Messages
14,111
Reaction score
690
Points
166
cite la cmner nak edit..
kalo 2 link tu je yg ko paste, mmg anip da masuk awal2 da..
tp pe dorang discuss tu belit2 la..:((anip ikut step2 pon x jd..

sbb tu tnye sini mne tau ada org yg leh explain detail..

ko tahu edit2 string dalam phpmyadmin tak?
 

DDos

Legendary Member
Joined
Nov 7, 2007
Messages
14,111
Reaction score
690
Points
166
benda ni berkait ngan string-charset dalam ko punya phpmyadmin, so aku tak tau nak tunjuk camana, bergantung kepada ko sebab skrang ko yg guna, aku dah lama tak guna phpbb ni, tak tau struktur baru dia camana
 

DDos

Legendary Member
Joined
Nov 7, 2007
Messages
14,111
Reaction score
690
Points
166
1st sekali ko dah chek minimun requirement phpmyadmin adakah versionnya menepati yg dibekalkan oleh hosting ko untuk digunakan oleh phpbb

cthnya macam kat bawah ni

 

DDos

Legendary Member
Joined
Nov 7, 2007
Messages
14,111
Reaction score
690
Points
166
skrang ko punya "MySQL connection collation" guna apa?

UTF-8 Unicode?
 
Sponsored Post

CG Sponsors




Top
Log in Register