Unicode problem
-
Hi there, i have a database which contain some junk character in some fields like for ex:"è" i need to replace this junk character into "è" the application where iam using this database is ASP page and need to have a solution where at one shot i can replace all this junk charac in my database fields there are around 7 different junk character in 5 fields and i have 500 records like this in my database i try to solve this problem with the javascript but i need a connection so that in one click i can loop thro all the fields and replace the character but cant do it here is the code snippet : sqlqry="" set rstest=server.CreateObject("ADODB.Recordset") sqlqry = "select Title, Description, Description_abtract, Dc_source, Rights_Rightsholder from Articles_production" rstest.Open sqlqry,conn,3,3 var str= sqlqry (str.replace(/è/gi,"è")) (str.replace(/é/gi,"é")) (str.replace(/’/gi,"’")) (str.replace(/“/gi,"“")) (str.replace(/â€/gi,"”")) (str.replace(/ç/gi,"ç")) (str.replace(/ä/gi,"ä")) pls any solutions regards cyus
-
Hi there, i have a database which contain some junk character in some fields like for ex:"è" i need to replace this junk character into "è" the application where iam using this database is ASP page and need to have a solution where at one shot i can replace all this junk charac in my database fields there are around 7 different junk character in 5 fields and i have 500 records like this in my database i try to solve this problem with the javascript but i need a connection so that in one click i can loop thro all the fields and replace the character but cant do it here is the code snippet : sqlqry="" set rstest=server.CreateObject("ADODB.Recordset") sqlqry = "select Title, Description, Description_abtract, Dc_source, Rights_Rightsholder from Articles_production" rstest.Open sqlqry,conn,3,3 var str= sqlqry (str.replace(/è/gi,"è")) (str.replace(/é/gi,"é")) (str.replace(/’/gi,"’")) (str.replace(/“/gi,"“")) (str.replace(/â€/gi,"”")) (str.replace(/ç/gi,"ç")) (str.replace(/ä/gi,"ä")) pls any solutions regards cyus
You could (should be able to depending on the database u r using?) do the entire thing at the database level, below is a mssql example - update Articles_production set Description = replace(Description,'junk character','replacement character'), Description_abtract = .... You may however have to run the update statement for each junk character.
-
You could (should be able to depending on the database u r using?) do the entire thing at the database level, below is a mssql example - update Articles_production set Description = replace(Description,'junk character','replacement character'), Description_abtract = .... You may however have to run the update statement for each junk character.
-
Hi jeffrey, i try the above qury in my query Analyzer it show me error: argument data type ntext is invalid for argument 1 of replace function. To support unicode character i created datatype as ntext. :) Regards cyus
if you know that the data in the columns doesn't exceed a length of 8000 you could try something like - update Table1 set test1=replace(convert(varchar(8000),test1),'x','a'), test2=replace(convert(varchar(80000),test2),'x','a') Otherwise you might have to go the code route.
-
if you know that the data in the columns doesn't exceed a length of 8000 you could try something like - update Table1 set test1=replace(convert(varchar(8000),test1),'x','a'), test2=replace(convert(varchar(80000),test2),'x','a') Otherwise you might have to go the code route.
hey Jeffery, i try this in my code but some problem in the updated stmt can u help me shoot wht the problem is the compiler thro me error The name Var1 does not exist in the class or namespace of the project.... here is the codesnippet string strsql; DataTable dt; SqlDataAdapter da; SqlConnection objConn = new SqlConnection("data source=yusuff;user id=sa;password=sa;initial catalog=Heritage"); dt = new DataTable(); strsql = "select * from Articles_production"; da = new SqlDataAdapter(strsql,objConn); da.Fill(dt); if(dt.Rows.Count > 0) { //foreach (DataRow dr in dt.Rows) //ervy loop for (int i=0;i