Results 1 to 5 of 5

Thread: HOW to decode this string in ascii code

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,958

    HOW to decode this string in ascii code

    i just have decoded only:

    \u00E8="è"

    ...
    \u00E8
    \u00E0
    \u0027A
    \u0027O
    \u00F9
    \u00E9r
    \u00E8r
    \u00E9
    \u00C8t
    \u00F4n
    \u00E7a
    \u00E9
    \u00EAm
    \u00E9m
    \u00E8s
    \u0027
    \u00F2
    \u00EC
    \u00E8y
    \u0027E
    \u0027I
    \u00F9
    \u00E0
    ...

    in other case i use this code to return value:

    ...
    URL = "https://situas-servizi.istat.it/publish/reportspooljson?pfun=51&pdata=17/03/1861"

    Set xmlhttp = CreateObject("MSXML2.XMLHTTP")
    xmlhttp.Open "GET", URL, False
    xmlhttp.send

    STRINGA= xmlhttp.responseText

    Dim F As Integer
    F = FreeFile
    Open "C:\TABULATI\ISTAT_COMUNI.txt" For Output As #F
    Print #F, STRINGA
    Close #F

    ...

    For AN idea see the First comune Is Agliè... In txt file
    Attached Files Attached Files
    Last edited by luca90; Jul 8th, 2026 at 03:36 AM.

  2. #2
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    6,755

    Re: HOW to decode this string in ascii code

    These mapping are escaped Unicoded characters.
    You can not simply map these to ANSI

  3. #3
    Lively Member
    Join Date
    Jan 2025
    Posts
    72

    Re: HOW to decode this string in ascii code

    Try this code:
    Code:
    Sub RemplacerCode()
        Dim Source As String
        Dim Destination As String
        Dim nFile As Integer
        Dim content As String
        
        Dim segments() As String
        Dim i As Long
        Dim Hexa As String
      
        Dim resultat As String
       
        Source = "C:\Users\pc\Downloads\ISTAT_COMUNI\ISTAT_COMUNI.txt"
        Destination = "C:\Users\pc\Downloads\ISTAT_COMUNI\ISTAT_COMUNI 2.txt"
     
        nFile = FreeFile
        Open Source For Input As #nFile
            content = Input(LOF(nFile), #nFile)
        Close #nFile
        
        segments = Split(content, "\u00")
         
        For i = 1 To UBound(segments)
            Hexa = Left$(segments(i), 2) '
            segments(i) = Chr$(Val("&H" & Hexa)) & Mid$(segments(i), 3)
        Next
        
        resultat = Join(segments, "") 
        
        nFile = FreeFile
        Open Destination For Output As #nFile
            Print #nFile, resultat;
        Close #nFile
    
        MsgBox "Finish"
    End Sub
    Last edited by anycoder; Jul 8th, 2026 at 08:17 AM.

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,958

    Re: HOW to decode this string in ascii code

    Quote Originally Posted by anycoder View Post
    Try this code:
    Code:
    Sub RemplacerCode()
        Dim Source As String
        Dim Destination As String
        Dim nFile As Integer
        Dim content As String
        
        Dim segments() As String
        Dim i As Long
        Dim Hexa As String
      
        Dim resultat As String
       
        Source = "C:\Users\pc\Downloads\ISTAT_COMUNI\ISTAT_COMUNI.txt"
        Destination = "C:\Users\pc\Downloads\ISTAT_COMUNI\ISTAT_COMUNI 2.txt"
     
        nFile = FreeFile
        Open Source For Input As #nFile
            content = Input(LOF(nFile), #nFile)
        Close #nFile
        
        segments = Split(content, "\u00")
         
        For i = 1 To UBound(segments)
            Hexa = Left$(segments(i), 2) '
            segments(i) = Chr$(Val("&H" & Hexa)) & Mid$(segments(i), 3)
        Next
        
        resultat = Join(segments, "") 
        
        nFile = FreeFile
        Open Destination For Output As #nFile
            Print #nFile, resultat;
        Close #nFile
    
        MsgBox "Finish"
    End Sub

    GREAT!
    tks bro, work!!!!!!

  5. #5
    Junior Member woeoio's Avatar
    Join Date
    Jan 2022
    Posts
    29

    Re: HOW to decode this string in ascii code

    You may try vbman asynchronous download and convert json objects. You can use it freely. The compressed package contains the way to obtain vbman and more sample codes. It is open source and free.
    Attached Images Attached Images  
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width