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

    Leggere txt scritto in giapponese

    Ciao a tutti,
    ho un problema con le lingue asiatiche (sia in programmazione, sia nella vita reale )
    In pratica ho una pagina semplicissima che è composta da un textarea. Questo deve essere popolato dal testo presente in un file.

    Il problema è che il testo è in giapponese e se lo leggo con FSO (sia in UTF sia normalmente), nel textarea vengono scritti tanti "?????" e altre schifezze.
    Se invece apro il file con notepad e lo incollo dentro la text area, il testo compare in giapponese!!

    Che posso fare?

  2. #2
    Ho risolto =)

    codice:
    <body>
    <%
    testo = request.Form("textarea")
    response.Write(server.HTMLEncode(testo))
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    
    ' Open the file as a text stream (1 = ForReading, True = Create)
    Set objCountFile = objFSO.OpenTextFile(Server.MapPath("japan.txt"), 1, True, -1)
    
    ' Read the current count from the file
    'If Not objCountFile.AtEndOfStream Then
    	' Set value to contents of the file
    	iCount = objCountFile.ReadAll
    
    	' If no file exists or it's empty start at 0
    	
    'End If
    
    ' Close the file and destroy the object
    objCountFile.Close
    Set objCountFile = Nothing
    %>
    
    
    <form name="form1" method="post" action="test_giappo.asp">
      
    
    
        <textarea name="textarea" cols="100" rows="10"><%=server.HTMLEncode(icount)%></textarea>
      </p>
      
    
    
        <input type="submit" name="Submit" value="Submit">
      </p>
    </form>
    </body>

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 © 2024 vBulletin Solutions, Inc. All rights reserved.