Login

mvnForum

mvnForum Homepage Welcome Guest
  Search  
  Index  | Recent Threads  | Unanswered Threads  | List Polls  | Public Albums  | Who's Online  | Help


Quick Go »


No member browsing this thread
Thread Status: Active
Total posts in this thread: 6
Post new Thread
Author
Previous Thread This topic has been viewed 1797 times and has 5 replies Next Thread
Male j2me
Stranger




Joined: May 25, 2006
Post Count: 4
Status: Offline
Reply to this Post  Reply with Quote 
انا عندي مشكلة باللغة العربية عندما اضيف موضوع يخرج النص كله ؟؟؟؟؟؟؟؟؟؟؟؟

السلام عليكم
انا عندي مشكلة باللغة العربية عندما اضيف موضوع يخرج النص كله ؟؟؟؟؟؟؟؟؟؟؟؟، ماذا أفعل لكي يخرج النص سليم
و شكرا لكم

hi
i install the forum ,and it is very good
but when i write in arbic text will be ?????????/
what can i do
Thank you
[May 25, 2006 5:29:14 AM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest [Link] Report threatening or abusive post: please login first  Go to top 
Male j2me
Stranger




Joined: May 25, 2006
Post Count: 4
Status: Offline
Reply to this Post  Reply with Quote 
I solve the problem

hi
I solve the problem
first all table in dataBase must be UTF-8
if you want to create table in my SQL do like that
CREATE TABLE `mvnforumattachment` (
`AttachID` int(11) NOT NULL auto_increment,
`PostID` int(11) NOT NULL,
`MemberID` int(11) NOT NULL,
`AttachFilename` varchar(250) NOT NULL,
`AttachFileSize` int(11) NOT NULL,
`AttachMimeType` varchar(70) NOT NULL,
`AttachDesc` text NOT NULL,
`AttachCreationIP` varchar(20) NOT NULL,
`AttachCreationDate` datetime NOT NULL,
`AttachModifiedDate` datetime NOT NULL,
`AttachDownloadCount` int(11) NOT NULL,
`AttachOption` int(11) NOT NULL,
`AttachStatus` int(11) NOT NULL,
PRIMARY KEY (`AttachID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8

wink crying

then in class net.myvietnam.mvncore.util.GenericParamUtil in method
getParameter
do like that

public static String getParameter(GenericRequest request, String param) {

String ret = request.getParameter(param);
ret = StringUtil.getUTF8String(ret);
if (ret == null) ret = "";
return ret.trim();
}



method getUTF8String is

public static String getUTF8String(String strSrc)
{

String temp = null;
try
{
if(strSrc != null){
char[] chrSrc = strSrc.toCharArray();
byte[] byteSrc = new byte[chrSrc.length];
for(int i=0; i < chrSrc.length; i++){
byteSrc = (byte)chrSrc;
}
temp = new String(byteSrc, "UTF-8");
}
}catch(Exception e){

}
return temp;

}

thats all
biggrin sad laughing
[May 26, 2006 1:54:35 PM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest [Link] Report threatening or abusive post: please login first  Go to top 
Male hallywang
Stranger




Joined: Sep 18, 2006
Post Count: 9
Status: Offline
Reply to this Post  Reply with Quote 
Re: I solve the problem

i am Chinese~~

welcome visit my website

www.qqhally.com/bbs
[Oct 20, 2006 9:35:06 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male megacb
mvnForum developer




Joined: Jan 21, 2008
Post Count: 123
Status: Offline
Reply to this Post  Reply with Quote 
Re: I solve the problem

hi
I solve the problem
first all table in dataBase must be UTF-8
if you want to create table in my SQL do like that
CREATE TABLE `mvnforumattachment` (
`AttachID` int(11) NOT NULL auto_increment,
`PostID` int(11) NOT NULL,
`MemberID` int(11) NOT NULL,
`AttachFilename` varchar(250) NOT NULL,
`AttachFileSize` int(11) NOT NULL,
`AttachMimeType` varchar(70) NOT NULL,
`AttachDesc` text NOT NULL,
`AttachCreationIP` varchar(20) NOT NULL,
`AttachCreationDate` datetime NOT NULL,
`AttachModifiedDate` datetime NOT NULL,
`AttachDownloadCount` int(11) NOT NULL,
`AttachOption` int(11) NOT NULL,
`AttachStatus` int(11) NOT NULL,
PRIMARY KEY (`AttachID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8

wink crying

then in class net.myvietnam.mvncore.util.GenericParamUtil in method
getParameter
do like that

public static String getParameter(GenericRequest request, String param) {

String ret = request.getParameter(param);
ret = StringUtil.getUTF8String(ret);
if (ret == null) ret = "";
return ret.trim();
}



method getUTF8String is

public static String getUTF8String(String strSrc)
{

String temp = null;
try
{
if(strSrc != null){
char[] chrSrc = strSrc.toCharArray();
byte[] byteSrc = new byte[chrSrc.length];
for(int i=0; i < chrSrc.length; i++){
byteSrc = (byte)chrSrc;
}
temp = new String(byteSrc, "UTF-8");
}
}catch(Exception e){

}
return temp;

}

thats all
biggrin sad laughing

try this value for <database_url> in mvncore.xml if you use MySQL intead of modifying source code
<database_url>jdbc:mysql://localhost/mvnforum?useUnicode=true&characterEncoding=utf-8&useOldUTF8Behavior=true</database_url>

----------------------------------------
[Edit 1 times, last edit by megacb at Mar 13, 2008 9:48:03 AM]
[Mar 3, 2008 8:41:39 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male olaola
Stranger




Joined: Feb 14, 2005
Post Count: 7
Status: Offline
Reply to this Post  Reply with Quote 
Re: I solve the problem

Hi, developer, I did a fresh install yesterday.


try this value for <database_url> in mvncore.xml if you use MySQL intead of modifying source code
<database_url>jdbc:mysql://localhost/mvnforum?useUnicode=true&characterEncoding=utf-8&useOldUTF8Behavior=true</database_url>


I think this is default setting, but i can not work with it on mysql 5.0.51 and tomcat 6, everytime i insert chinese characters, i got exception, then I searched old post here, i found if i change the url to jdbc:mysql://localhost/mvnforum?useServerPrepStmts=false, i can post chinese successfully, but all the characters are displayed as "?"

i know it could be mysql setting, but i have executed the command:
alter database mvnforum character set utf8 collate utf8_general_ci;

is this suppose to let mysql use utf-8. did i miss anything?
[May 16, 2008 3:26:05 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male minhnn
mvnForum Developer
Member's Avatar

Vietnam
Joined: Oct 16, 2002
Post Count: 2956
Status: Offline
Reply to this Post  Reply with Quote 
Re: I solve the problem

i know it could be mysql setting, but i have executed the command:
alter database mvnforum character set utf8 collate utf8_general_ci;


Yes, this is MySQL config issue, not related to mvnForum.

It is quite difficult to config MySQL to support UTF-8, please read more on the MySQL documentation
----------------------------------------
Minh Nguyen
mvnForum Developer
Want a free, open source Java Jsp/Servlet forum, get mvnForum at http://www.mvnForum.com

http://www.DienDanLinux.org
[May 20, 2008 11:36:02 AM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest    http://www.MyVietnam.net    minhnn_mvn [Link] Report threatening or abusive post: please login first  Go to top 
Show Printable Version of Thread  Post new Thread