Upload - use unicode (utf-8) character set for request/response data

          Sample for ScriptUtils.ASPForm.CharSet 

Examples
Upload - use unicode (utf-8) character set for request/response data 
<%
'Sample file Unicode.asp
'Use unicode (utf-8) character set for request/response data.
  
  Dim Form: Set Form = Server.CreateObject("ScriptUtils.ASPForm")
  
  Response.Charset = "utf-8"

  If Form.State = 0 Then 
    'Set conversion character set.
    Form.CharSet = Response.Charset
    '

    Dim DestFolder: DestFolder = Server.MapPath("UploadFolder")
    
    'Saev source files
    Form.Files.Save DestFolder

    For Each Item In Form
      I = I + 1
      Response.Write "<br><br>Item no.:" & I
      Response.Write "<br>Length:" & Item.Length

      'Write unicode name of the source field.
      WriteUTF8Data "<br>Name:" & Item.Name
      If Item.IsFile Then
        'Write unicode value of the source file name.
        WriteUTF8Data "<br>File path:" & Item.FilePath

        'Write source UTF-8 representation (encoded) of the same value
        WriteUTF8Data "<br>Source path, encoded by UTF-8:" & Item.FilePath("x-ansi")
      Else' Item.IsFile then
        'Write contents for non-file fields.

        'Write unicode value of the source field.
        WriteUTF8Data "<br>Value:" & Item.String

        'Write source representation of the same value
        WriteUTF8Data "<br>Source value, encoded by UTF-8:" & Item.String("x-ansi")
      End If' Item.IsFile then

    Next
    Response.End
  End If

  'Create HTML output in ANSI code page
  Dim HTML
  HTML = "This form demonstrates use of unicode (utf-8) character set for text fields and file names<br>"
  HTML = HTML & "Try to write text / select filename with characters not in U.S. ASCII character subset.<br>"
  HTML = HTML & "<form name=file_upload method=POST ENCTYPE=multipart/form-data>"
  HTML = HTML & "<input Name=Description1 Size=50 Value=""Some non-U.S. ASCII chars - ìšèøžýáíéÌŠÈØŽ""><br>"
  HTML = HTML & "<input Name=File1 Type=File><br>"
  HTML = HTML & "<input Value=Submit >> Type=Submit><br>"
  HTML = HTML & "</Form>"


WriteUTF8Data HTML

'Write utf-8 data using Session.CodePage
Sub WriteUTF8Data1(HTML)  

  Session.CodePage = 65001
  Response.Write HTML
End Sub

'Write utf-8 data using ScriptUtils.ByteArray, without session object.
Sub WriteUTF8Data(HTML)  

  Dim ByteArray
  Set ByteArray = CreateObject("ScriptUtils.ByteArray") 

  'set ByteArray charset to UTF-8 (code page 65001)
  ByteArray.CharSet = "utf-8"

  'Write HTML data to byte array
  ByteArray.String = HTML

  'Write binary data to output.
  Response.BinaryWrite ByteArray.ByteArray
End Sub
  
%>
  Other links for Upload - use unicode (utf-8) character set for request/response data
The ASPForm collection retrieves the values of form elements posted to ASP script by a form using the POST method. ASPForm can process multipart/form-data or application/x-www-form-urlencoded data with length up to 2GB.
      Easy to use, hi-performance ASP file upload component with progress bar indicator. Let's you upload multiple files with size up to 2GB to a disk or database along with another form fields. Works with large posts, any character set (including unicode utf-8). Contains one-click multiple files/folders download with on-the-fly compression (Using BinaryWrite/BinaryRead).
      Hi-performance text file logging for ASP/VBScript/VBA applications. Lets you create daily/weekly/monthly log files with variable number of logged values and extra timing and performance info.
       Lets you work with safearray binary data in VBS/JS. It also enables conversion between binary and String data using several code pages. ZLib compress and uncompress functions. Lets you transfer files using compressed stream from a client to server using IE.
      This library also enables calling of some Kernel and Advapi functions (performance, timing, sleep, configuration ...) and enables native work with INI files.


© 1996 – 2005 Motobit Software, help{at}pstruh.cz, help v. 2.16.14