The qDecoder Project

Modify Delete Post Reply Forward List
Written by 서광호 ([email protected]) Hits: 40 , Lines: 210
Re: RE: [qDecoder] 버그인지는 모르겠지만….
qURLencode가 아니라 qURLdecode 였어요. 죄송합니다..
아무튼 문제가 있긴 해요..
결과가 아래와 같이 나옵니다.

query_string이 sss="%2000%" 일경우…

sss = " 00?

이렇게 나오고요……

query_string이 sss=%22+00%25%22 이면

sss = " 00%"

이렇게 나옵니다..

이 문제에 대해서 알수 있는 url 알려드리겠습니다..

http://www.blooberry.com/indexdot/html/topics/urlencoding.htm

그리고.. 제가 해결했긴 했는데 제대로 했는지 모르겠습니다..

/* Heximal 코드 이면 1 아니면 0을 리턴 */
int isHex(char c)
{
   if((c >= ‘0’) && (c <= ‘9’)) return 1;
   else if((c >= ‘A’) && (c <= ‘Z’)) return 1;
   else if((c >= ‘a’) && (c <= ‘z’)) return 1;
   else return 0;
}

/**********************************************
** Usage : qURLdecode(Query Pointer);
** Return: Pointer of Query string
** Do    : Decode query string
**********************************************/
void qURLdecode(char *str){
 int i, j;

 if(!str)return;
 for(i = j = 0; str[j]; i++, j++){
   switch(str[j]){
     case ‘+’:{
       str[i] = ‘ ‘;
       break;
     }
     case ‘%’:{
if (!str[j+1]) break;
/* ‘%’ 뒤에 오는 문자가 Heximal 인지 판단 */
if (!isHex(str[j+1]))
{
str[i] = str[j];
break;
}

       str[i] = _x2c(str[j + 1], str[j + 2]);
       j += 2;
       break;
     }
     default:{
       str[i] = str[j];
       break;
     }
   }
 }
 str[i]=’’;
}



Seung-young Kim wrote:
> This is a multi-part message in MIME format.
>
> ——=_NextPart_000_0017_01C167AD.954E62F0
> Content-Type: text/plain;
> charset="ks_c_5601-1987"
> Content-Transfer-Encoding: 8bit
>
> 두개의 결과가 어떻게 출력되는지 결과를 알려주시겠습니까…
>
> —
> Seung-young Kim
> OpenBIRD, Inc. http://www.openbird.com
>
>   —–Original Message—–
>   From: [email protected] [mailto:[email protected]]On
> Behalf Of 서광호
>   Sent: Wednesday, November 07, 2001 2:44 PM
>   To: [email protected]
>   Subject: [qDecoder] 버그인지는 모르겠지만….
>
>
>   안녕하세요..
>
>   qDecoder 넘 잘 쓰고 있습니다. 좋은 라이브러리 만들어 주셔서 정말 편하게
> 개발하고 있습니다.
>   다름이 아니라.. qURLencode 함수에 약간의 오류아닌 오류가 있어서요.
>
>   아래 HTML 소스 가지고 qValue("sss"); 를 한번 출력해보세요.. 해보시면
> 두개의 결과가 틀립니다.
>   같아야 되거든요…..
>
>   감사합니다..
>
>
>   <script language=’JavaScript’>
>   <!–
>   function xxx()
>   {
>    window.location.href = ‘test.cgi?sss=’+document.test.sss.value;
>   }
>   //–>
>   </script>
>   <form action=’test.cgi’ name=test>
>   <input type=text name=’sss’ value=’" 00%"’>
>   <input type=button value=’bad’ onclick=’xxx()’>
>   </form>
>
>   <form action=’test.cgi’ >
>   <input type=text name=’sss’ value=’" 00%"’>
>   <input type=submit value=’good’ >
>   </form>
>
>
> ——=_NextPart_000_0017_01C167AD.954E62F0
> Content-Type: text/html;
> charset="ks_c_5601-1987"
> Content-Transfer-Encoding: quoted-printable
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD>
> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
> charset=3Dks_c_5601-1987">
>
>
> <META content=3D"MSHTML 5.50.4807.2300" name=3DGENERATOR>
> <STYLE></STYLE>
> </HEAD>
> <BODY bgColor=3D#ffffff>
> <DIV><SPAN class=3D560215907-07112001><FONT color=3D#0000ff =
> size=3D2>=B5=CE=B0=B3=C0=C7 =B0=E1=B0=FA=B0=A1 =BE=EE=B6=BB=B0=D4 =
> =C3=E2=B7=C2=B5=C7=B4=C2=C1=F6=20
> =B0=E1=B0=FA=B8=A6 =
> =BE=CB=B7=C1=C1=D6=BD=C3=B0=DA=BD=C0=B4=CF=B1=EE…</FONT></SPAN></DIV>
> <DIV> </DIV>
> <P><FONT size=3D2>–<BR>Seung-young Kim<BR>OpenBIRD, Inc. <A =
> target=3D_blank=20
> href=3D"http://www.openbird.com/">http://www.openbird.com</A></FONT> =
> </P>
> <BLOCKQUOTE dir=3Dltr=20
> style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px =
> solid; MARGIN-RIGHT: 0px">
>   <DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
> face=3DTahoma=20
>   size=3D2>—–Original Message—–<BR><B>From:</B> =
> [email protected]=20
>   [mailto:[email protected]]<B>On Behalf Of =
> </B>=BC=AD=B1=A4=C8=A3<BR><B>Sent:</B>=20
>   Wednesday, November 07, 2001 2:44 PM<BR><B>To:</B>=20
>   [email protected]<BR><B>Subject:</B> [qDecoder] =
> =B9=F6=B1=D7=C0=CE=C1=F6=B4=C2=20
>   =B8=F0=B8=A3=B0=DA=C1=F6=B8=B8….<BR><BR></FONT></DIV>
>   <DIV><FONT size=3D2>=BE=C8=B3=E7=C7=CF=BC=BC=BF=E4..</FONT></DIV>
>   <DIV><FONT size=3D2></FONT> </DIV>
>   <DIV><FONT size=3D2>qDecoder =B3=D1 =C0=DF =BE=B2=B0=ED =
> =C0=D6=BD=C0=B4=CF=B4=D9. =C1=C1=C0=BA =B6=F3=C0=CC=BA=EA=B7=AF=B8=AE =
> =B8=B8=B5=E9=BE=EE =C1=D6=BC=C5=BC=AD =C1=A4=B8=BB =C6=ED=C7=CF=B0=D4 =
> =B0=B3=B9=DF=C7=CF=B0=ED=20
>   =C0=D6=BD=C0=B4=CF=B4=D9.</FONT></DIV>
>   <DIV><FONT size=3D2>=B4=D9=B8=A7=C0=CC =BE=C6=B4=CF=B6=F3.. qURLencode =
> =C7=D4=BC=F6=BF=A1 =BE=E0=B0=A3=C0=C7 =BF=C0=B7=F9=BE=C6=B4=D1 =
> =BF=C0=B7=F9=B0=A1 =C0=D6=BE=EE=BC=AD=BF=E4.</FONT></DIV>
>   <DIV><FONT size=3D2></FONT> </DIV>
>   <DIV><FONT size=3D2>=BE=C6=B7=A1 HTML =BC=D2=BD=BA =B0=A1=C1=F6=B0=ED =
> qValue("sss"); =B8=A6 =C7=D1=B9=F8 =
> =C3=E2=B7=C2=C7=D8=BA=B8=BC=BC=BF=E4.. =C7=D8=BA=B8=BD=C3=B8=E9 =
> =B5=CE=B0=B3=C0=C7 =B0=E1=B0=FA=B0=A1=20
>   =C6=B2=B8=B3=B4=CF=B4=D9.</FONT></DIV>
>   <DIV><FONT size=3D2>=B0=B0=BE=C6=BE=DF =
> =B5=C7=B0=C5=B5=E7=BF=E4…..</FONT></DIV>
>   <DIV><FONT size=3D2></FONT> </DIV>
>   <DIV><FONT size=3D2>=B0=A8=BB=E7=C7=D5=B4=CF=B4=D9..</FONT></DIV>
>   <DIV><FONT size=3D2></FONT> </DIV>
>   <DIV><FONT size=3D2></FONT> </DIV>
>   <DIV><FONT size=3D2><script =
> language=3D’JavaScript’><BR><!–<BR>function=20
>   xxx()<BR>{<BR> window.location.href =3D=20
>   =
> ‘test.cgi?sss=3D’+document.test.sss.value;<BR>}<BR>//–><BR></scrip=
> t><BR><form=20
>   action=3D’test.cgi’ name=3Dtest><BR><input type=3Dtext =
> name=3D’sss’ value=3D’"=20
>   00%"’><BR><input type=3Dbutton value=3D’bad’=20
>   onclick=3D’xxx()’><BR></form></FONT></DIV>
>   <DIV><FONT size=3D2></FONT> </DIV>
>   <DIV><FONT size=3D2><form action=3D’test.cgi’ ><BR><input =
> type=3Dtext=20
>   name=3D’sss’ value=3D’" 00%"’><BR><input type=3Dsubmit =
> value=3D’good’=20
>   ><BR></form><BR></FONT></DIV></BLOCKQUOTE></BODY></HTML>
>
> ——=_NextPart_000_0017_01C167AD.954E62F0–
>
> —
> The qDecoder Project           <http://www.qDecoder.org>
> To unsubscribe: send mail to [email protected] with
> "unsubscribe qDecoder" in the body of the message.
>

Prev : RE: [qDecoder] 버그인지는 모르겠지만….
Next : [qDecoder] 버그인지는 모르겠지만….
November 8, 2001 (10:22) from 210.181.122.239
CrazyWWWBoard 98 Professional Edition II
Modify Delete Post Reply Forward List

[Home] [About] [Examples] [Changes] [Download] [Install] [Reference] [Bugs] [Q&A;]
Netchestra bizWorker