Hello J,

Monday, September 11, 2000, 7:08:54 PM, you wrote:
JW> I just made some changes to the admin site to handle Chinese character set.
JW> Now the site can properly handle Chinese GB input and display. There are 
JW> some points I'd like to share with the development team to improve the code 
JW> for multi-byte code support. This is actually very easy and not much change 
JW> needed for coding. I only made the following two changes:
Thank you for this report. It is simple workaround that will surely help
other users. However, I have some comments (they all about 1.4 betas):
JW> 1. Go to Host Admin -> Select Admin site -> Edit root page: Admin Root ->
JW> Page elements code-global -> Modify
JW> All occurrence of PHP function htmlentities() was changed to 
JW> htmlspecialchars(). The later is a better version of the function doing the 
JW> same job and not restricted to particular character set.
That's not correct. htmlentities() does conversion of HTML entities
which are characters with codes greater than 160, while
htmlspecialchars() does conversion of "special chars" like < > & and
so on. Former function stricly needed if charset of the page set to
ISO-8859-1 (Latin-1), while latter one should be used in all cases.

JW> 2. Go to Host Admin -> Select Admin site -> Edit root page: Admin Root -> 
SubPage topic ->> subpage article -> Modify
JW> Replace all &(article.title); to <? echo $article->title; ?>
JW> Do the same for article.abstract, article.content, article.name, 
JW> &(title),&(abstract),&(content),&(name)
JW> The Midgard manual acclaims that &(string) does the same thing as <? echo 
JW> string ?>. But apparently it is not for at least Chinese character set. I
JW> think the underlying code needs to be changed to let this syntax honestly 
JW> comply its PHP counterpart.
&(string) does the same as <? echo $string; ?> when MidgardParser set
to 'russian' (so known 'Russian Midgard mode').

JW> With above simple changes, Chinese character set is properly handled for 
JW> content diplaying and input. It is actually very simple. I recommend that 
JW> the development could think about this and made a little change in the code. 
JW> (The same code works for any other character set too.) I would like to help 
JW> if needed.
It is already done in Russian Midgard Admin Site, and in Asgard (Admin
Site for 1.4final) there will be function asgard_localized_name()
which does needed conversion (htmlspecialchars+htmlentities if needed)
for corresponding Admin Site's translation. For Chinese (and Cyrillic
too) mode it will be set do htmlspecialchars() only.

-- 
Best regards,
 Alexander                            mailto:[EMAIL PROTECTED]



--
This is The Midgard Project's mailing list. For more information,
please visit the project's web site at http://www.midgard-project.org

To unsubscribe the list, send an empty email message to address
[EMAIL PROTECTED]

Reply via email to