Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: tumickey on November 25, 2005, 09:19:19 PM

Title: problem with uft-8 ?
Post by: tumickey on November 25, 2005, 09:19:19 PM
I have posted recently a topic about a problem in the display of topic .
I from Vietnam.

And this problem

http://www.nhipsongcantho.com/forum/index.php?topic=174.0

i find thist problem is parse_bbc() in subs.php

please help me
Title: Re: problem with uft-8 ?
Post by: Sheepy on November 25, 2005, 11:36:15 PM
What's the problem and what charset you're using?
Title: Re: problem with uft-8 ?
Post by: tumickey on November 26, 2005, 06:28:43 AM
it's Vietnamese.

QuoteTừ nhiều năm qua, ở Nhænbsp; VHTN quận Ninh Kiều, phần mặt tiền đường Lý Tự Trọng lænbsp; gian phòng dænbsp;nh cho cửa hiệu may quần áo (không rõ đây lænbsp; chủ trương dạy may quần áo cho các cháu thiếu nhi hay cho tư nhân thuê ?) còn cả tầng 2 của tòa nhænbsp; thì dænbsp;nh cho các lớp dạy thể dục thẫm mỹ, thể dục nhịp điệu, massage, chăm sóc lænbsp;m đẹp vænbsp;

so good is

QuoteTừ nhiều năm qua, ở Nhà VHTN quận Ninh Kiều, phần mặt tiền đường Lý Tự Trọng là gian phòng dành cho cửa hiệu may quần áo (không rõ đây là chủ trương dạy may quần áo cho các cháu thiếu nhi hay cho tư nhân thuê ?) còn cả tầng 2 của tòa nhà thì dành cho các lớp dạy thể dục thẫm mỹ, thể dục nhịp điệu, massage, chăm sóc làm đẹp và tất nhiên đối tượng được phục vụ không phải là thiếu nhi.

if I don't use parse_bbc() then so real.

sorry i talk englst not good . :)
Title: Re: problem with uft-8 ?
Post by: Sheepy on November 26, 2005, 07:58:19 AM
A text sample is good.

There are at least four Vietnamese charset on Internet - TCVN, VIUSCII, VPS, and Windows-1258.

Some charset has to be handled differently from English, otherwise result in display error.

Don't know Vietnamese, but will try to see if can help.  Your English is not bad, good enough for support request. ^_^
Title: Re: problem with uft-8 ?
Post by: tumickey on November 26, 2005, 11:11:05 AM
oh thanks  (^__^)

Nhà -> Nhænbsp
là  -> lænbsp

=> à -> ænbsp

this problem ??

Title: Re: problem with uft-8 ?
Post by: Sheepy on November 26, 2005, 12:28:44 PM
I see.  Yes I understand now.  It is fixed in 1.1 RC 2.

You can try to censor all "ænbsp;" to be "à".  It worked for me.
Title: Re: problem with uft-8 ?
Post by: Sheepy on November 26, 2005, 12:32:59 PM
Oh and, forget about the charset stuff.  You already stated it is utf-8.  My flu is causing me to not think clearly. @_@

If the censor doesn't work, reply and I'll try to reproduce & fix it.  Given that I mod for Chinese community, I use UTF-8 a lot.  Just finish a UTF-8 parser for a mod last week, actually...
Title: Re: problem with uft-8 ?
Post by: tumickey on November 27, 2005, 08:24:49 AM
o thanks very much .
i try fix in Display.php

// Run BBC interpreter on the message.
   $message['body'] = parse_bbc($message['body'], $message['smileysEnabled'], $message['ID_MSG']);
   
$message['body'] = strtr($message['body'], array('<br />'=>'<br>','&nbsp;' => 'à'));

result is

Quote
༢r>Từ nhiều năm qua, ở Nhà VHTN quận Ninh Kiều, phần mặt tiền đường Lý Tự Trọng là gian phòng dành cho cửa hiệu may quần áo (không rõ đây là chủ trương dạy may quần áo cho các cháu thiếu nhi hay cho tư nhân thuê ?) còn cả tầng 2 của tòa nhà thì dành cho các lớp dạy thể dục thẫm mỹ, thể dục nhịp điệu, massage, chăm sóc làm đẹp và tất nhiên đối tượng được phục vụ không phải là thiếu nhi.

but

Quote

༩mg src="http://www.baocantho.com.vn/news/images/news/655/32.jpg" alt="" border="0" />
Nhiều thiết bị phục vụ trò chơi miễn phí (ở Nhà VHTN quận Ninh Kiều) đã xuống cấp mà không được tu sửa.
༢r>


problem is  &nbsp;

you have good code ?

Title: Re: problem with uft-8 ?
Post by: Sheepy on November 27, 2005, 09:11:58 AM
Try censor text instead, configured frmo admin panel.  And you may want to use "ænbsp;" => "à"  and  *after that* "&nbsp;" => " "
Title: Re: problem with uft-8 ?
Post by: tumickey on November 27, 2005, 10:36:47 AM
it's not word
but i try fix some code and it word :)

remove this code in Subs.php

// Cleanup whitespace.
$message = strtr($message, array('  ' => ' &nbsp;', "\r" => '', "\n" => '<br />', '<br /> ' => '<br />&nbsp;'));


next add this code in display.php

$message['body'] = strtr($message['body'], array('<br />'=>'<br>','&nbsp;' => 'à'));

after
// Run BBC interpreter on the message.
$message['body'] = parse_bbc($message['body'], $message['smileysEnabled'], $message['ID_MSG']);


:)

I should like to thank you very much for your help.
Title: Re: problem with uft-8 ?
Post by: tumickey on November 27, 2005, 10:37:33 PM
hic
it's not word good some where.
But i think have problem in template .
when I view source it's show real.
?
Title: Re: problem with uft-8 ?
Post by: Sheepy on November 29, 2005, 10:37:34 PM
when you view source it's show view??  ??? You mean it works in browser but not in source?