Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    Problemi di accenti e apostrofi

    Ho uno script di prodotti che ha questo problema:

    Quando inserisco la descrizione di un prodotto e uso parole con gli accenti tipo " è - à - ì " non viene visualizzata la parola con l'accento ma vengono visualizzati dei simboli strani.
    Ho notato però che nel database la parola viene registrata correttamente, e cioè " è - à - ì " .
    E' quindi la pagina dove legge dal database che "filtra" tali parole. Ho provato a vedere dove poter modificare ma questa volta non riesco proprio a capire dove stà l'inghippo.

    ecco il codice della pagina in questione:


    <%
    '************************************************* ***************************************
    '************************************************* ***************************************
    %>
    <%
    if(Request.QueryString("iPic") <> "") then cmdView__var_id = Request.QueryString("iPic")
    %>
    <%
    set cmdView = Server.CreateObject("ADODB.Command")
    cmdView.ActiveConnection = MM_connDUgallery_STRING
    cmdView.CommandText = "UPDATE PICTURES SET PIC_VIEW = PIC_VIEW + 1 WHERE PIC_ID = " + Replace(cmdView__var_id, "'", "''") + ""
    cmdView.CommandType = 1
    cmdView.CommandTimeout = 0
    cmdView.Prepared = true
    cmdView.Execute()
    %>
    <%
    Dim rsDetail__MMColParam
    rsDetail__MMColParam = "1"
    If (Request.QueryString("iPic") <> "") Then
    rsDetail__MMColParam = Request.QueryString("iPic")
    End If
    %>
    <%
    Dim rsDetail
    Dim rsDetail_numRows

    Set rsDetail = Server.CreateObject("ADODB.Recordset")
    rsDetail.ActiveConnection = MM_connDUgallery_STRING
    rsDetail.Source = "SELECT * FROM PICTURES, TYPES WHERE PIC_APPROVED = 1 AND PIC_TYPE = TYPE_ID AND PIC_ID = " + Replace(rsDetail__MMColParam, "'", "''") + ""
    rsDetail.CursorType = 0
    rsDetail.CursorLocation = 2
    rsDetail.LockType = 1
    rsDetail.Open()

    rsDetail_numRows = 0
    If rsDetail.EOF Then Response.Redirect("default.asp")
    %>


    <%
    Dim rsDetailPrev
    Dim rsDetailPrev_numRows

    Set rsDetailPrev = Server.CreateObject("ADODB.Recordset")
    rsDetailPrev.ActiveConnection = MM_connDUgallery_STRING
    rsDetailPrev.Source = "SELECT TOP 1 * FROM PICTURES WHERE PIC_APPROVED = 1 AND PIC_TYPE = " & Request.QueryString("iType") & " AND PIC_ID < " & Request.QueryString("iPic") & " ORDER BY PIC_ID DESC"
    rsDetailPrev.CursorType = 0
    rsDetailPrev.CursorLocation = 2
    rsDetailPrev.LockType = 1
    rsDetailPrev.Open()
    rsDetailPrev_numRows = 0
    %>


    <%
    Dim rsDetailNext
    Dim rsDetailNext_numRows

    Set rsDetailNext = Server.CreateObject("ADODB.Recordset")
    rsDetailNext.ActiveConnection = MM_connDUgallery_STRING
    rsDetailNext.Source = "SELECT TOP 1 * FROM PICTURES WHERE PIC_APPROVED = 1 AND PIC_TYPE = " & Request.QueryString("iType") & " AND PIC_ID > " & Request.QueryString("iPic") & " ORDER BY PIC_ID ASC"
    rsDetailNext.CursorType = 0
    rsDetailNext.CursorLocation = 2
    rsDetailNext.LockType = 1
    rsDetailNext.Open()
    rsDetailNext_numRows = 0
    %>


    <%
    Dim imgWidth, imgHeight, imgPercent, imgFixWidth, imgFixHeight

    imgWidth = rsDetail.Fields.Item("PIC_WIDTH").Value
    imgHeight = rsDetail.Fields.Item("PIC_HEIGHT").Value

    If imgWidth > 580 Then

    imgFixWidth = 580

    imgPercent = (imgFixWidth/imgWidth)

    imgFixHeight= (imgHeight*imgPercent)

    Else
    imgFixWidth = imgWidth
    imgFixHeight = imgHeight

    End If

    %>
    <SCRIPT LANGUAGE="JavaScript">

    <!-- Begin
    function OpenImage(img){
    foto1= new Image();
    foto1.src=(img);
    Controlla(img);
    }
    function Controlla(img){
    if((foto1.width!=0)&&(foto1.height!=0)){
    viewFoto(img);
    }
    else{
    funzione="Controlla('"+img+"')";
    intervallo=setTimeout(funzione,20);
    }
    }
    function viewFoto(img){
    largh=foto1.width+20;
    altez=foto1.height+20;
    stringa="width="+largh+",height="+altez;
    finestra=window.open(img,"",stringa);
    }
    // End -->
    </script>
    <link href="assets/DUgallery.css" rel="stylesheet" type="text/css">
    <div class = "links">
    <table width="552" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
    <td width="552"> <table width="100%" border="0" cellspacing="2" cellpadding="2">
    <tr>
    <td colspan="2" align="left" valign="middle" class="textBold">PRODOTTI
    &raquo; "><%=UCASE(rsDetail.Fields.Item("TYPE_NAME").Value )%> &raquo; SCHEDA PRODOTTO

    </td>
    </tr>
    <tr class="textBold">
    <td width="50%" align="left" valign="middle"> <% If Not rsDetailPrev.EOF Then %> &iType=<%=(rsDetailPrev.Fields.Item("PIC_TYPE").Va lue)%>">
    <% End If %> </td>
    <td width="50%" align="right" valign="middle"> <% If Not rsDetailNext.EOF Then %> <a href="detail.asp?iPic=<%=(rsDetailNext.Fields.Item ("PIC_ID").Value)%>&iType=<%=(rsDetailNext.Fields. Item("PIC_TYPE").Value)%>">
    </a> <% End If %> </td>
    </tr>
    <td colspan="2" align="left" valign="top"><table border="0" cellpadding="2" cellspacing="2" align="center">
    <tr align="center" valign="middle">
    <td width="214" height="136" rowspan="2" valign="top"> <font color="#666666">
    </font> <table width="208" border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td width="208" align="left" valign="top"> <table width="83%" border="0" align="center" cellpadding="0" cellspacing="2">
    <tr class="generalText">
    <td height="20" align="left" valign="middle" class="text">
    </td>
    <td height="20" align="right" valign="middle" class="textBlue"><div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><%=(rsDetail.Fields.Item("PIC_NAME").Value)%></font></div></td>
    </tr>
    <tr>
    <td colspan="2" align="center" class="text"> <table border="0" cellspacing="1" cellpadding="0" bgcolor="#000000">
    <tr>
    <td align="center" valign="middle" bgcolor="#CCCCCC">[img]images/<%=(rsDetail.Fields.Item([/img]" width = "<%= imgFixWidth %>" height = "<%= imgFixHeight %>" border="0" align="absmiddle"></td>
    </tr>
    </table></td>
    </tr>
    <tr class="generalText">
    <td height="20" colspan="2" align="left" valign="middle" class="text">
    </td>
    </tr>
    </table></td>
    </tr>
    </table></td>
    <td width="315" valign="top"> <div align="justify" class="textBlack">

    Descrizione:


    <font color="#666666" class="textGray"><%=(rsDetail.Fields.Item("PIC_DES CRIPTION").Value)%></font></div></td>
    </tr>
    <tr align="center" valign="middle">
    <td height="65" valign="bottom">
    <div align="left">Costo:
    <font color="#666666" class="textGray"><%=(rsDetail.Fields.Item("PIC_COS TO").Value)%></font></div></td>
    </tr>
    </table></td>
    </tr>
    <tr class="textBold">
    <td width="50%" align="left" valign="middle"> <% If Not rsDetailPrev.EOF Then %> <% End If %> </td>
    <td width="50%" align="right" valign="middle"> <% If Not rsDetailNext.EOF Then %> <a href="detail.asp?iPic=<%=(rsDetailNext.Fields.Item ("PIC_ID").Value)%>&iType=<%=(rsDetailNext.Fields. Item("PIC_TYPE").Value)%>">
    </a> <% End If %> </td>
    </tr>
    <tr align="center">
    <td height="17" colspan="2" valign="middle" class="text"></td>
    </tr>
    </table></td>
    </tr>
    </table>

    </div>


    <%
    rsDetail.Close()
    Set rsDetail = Nothing
    %>



    <%
    rsDetailPrev.Close()
    Set rsDetailPrev = Nothing
    %>


    <%
    rsDetailNext.Close()
    Set rsDetailNext = Nothing
    %>

  2. #2
    bella pagina.....


    CHARSET

  3. #3
    grazie è quello che cercavo.

    Per dover di cronaca e di esempio per altri, volevo dire come ho risolto.
    la pagina "detail.asp" includeva il codice che ho postato.

    ho sostituito "charset=UTF-8" con "charset=iso-8859-1" e tutto si è sistemato.


Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.