Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Print strings with accents and special chars
#6
I've reduced my program to the bare minimum, in order to try several printing options:

Code: (Select All)
Option _Explicit

Dim As Integer Ascii, Maximo
Dim As String Archivo, Ruta
Dim As Long Unicode, Fuente

Ruta = "C:\My Program Files\Externo virtual\Test"

Screen _NewImage(640, 480, 32)

Fuente = _LoadFont("C:\WINDOWS\FONTS\ARIALNB.TTF", 40)

Restore Microsoft_pc_cp850 'or restore single DATA field w/o field name
For Ascii = 128 To 255 'assign unicode values to ascii 128 to 255 only
    Read Unicode&
    If Unicode& = 0 Then Unicode& = 9744 'make undefined characters look like a box
    _MapUnicode Unicode& To Ascii 'replace ascii with unicode value
Next

Maximo = 1
Archivo = _Files$(Ruta + "\*.*")
_Font Fuente

Cls
Color _RGB(255, 255, 255)

Do While Archivo <> ""
    Dim puntoPos As Long
    puntoPos = InStr(Archivo, ".")
    If puntoPos > 0 Then
        Dim ext As String
        ext = LCase$(Mid$(Archivo, puntoPos + 1))
        If ext = "mp4" Or ext = "avi" Or ext = "mkv" Or ext = "mov" Or ext = "wmv" Or ext = "flv" Then
            Maximo = Maximo + 1
            _UPrintString (0, Maximo * 20), Archivo, , 0, Fuente
            _UPrintString (0, Maximo * 40), Archivo, , 8, Fuente
            _PrintString (0, Maximo * 60), Archivo
            Print Archivo
        End If
    End If
    Archivo = _Files$
    _Display
Loop

End

Microsoft_pc_cp850:
Data 199,252,233,226,228,224,229,231,234,235,232,239,238,236,196,197
Data 201,230,198,244,246,242,251,249,255,214,220,248,163,216,215,402
Data 225,237,243,250,241,209,170,186,191,174,172,189,188,161,171,187
Data 9617,9618,9619,9474,9508,193,194,192,169,9571,9553,9559,9565,162,165,9488
Data 9492,9524,9516,9500,9472,9532,227,195,9562,9556,9577,9574,9568,9552,9580,164
Data 240,208,202,203,200,305,205,206,207,9496,9484,9608,9604,166,204,9600
Data 211,223,212,210,245,213,181,254,222,218,219,217,253,221,175,180
Data 173,177,8215,190,182,167,247,184,176,168,183,185,179,178,9632,160



This is my result:


[Image: Sin-t-tulo.png]


But this is the original file name:


[Image: Sin-t-tulo.png]
10 PRINT "Hola! Smile"
20 GOTO 10
Reply


Messages In This Thread
RE: Print strings with accents and special chars - by Ikerkaz - 12-03-2025, 12:32 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Mac print #file crlf? BlameTroi 5 324 02-16-2026, 08:42 PM
Last Post: BlameTroi
  Are sub-strings strings? PhilOfPerth 19 1,280 12-27-2025, 01:57 PM
Last Post: Kernelpanic
  Tab() special behaviour in Console? zaadstra 17 1,265 12-06-2025, 02:08 PM
Last Post: bplus
  blue circle isn't drawing and print isn't working? madscijr 12 2,309 09-21-2024, 06:13 PM
Last Post: madscijr
  Assign print using to a string. eoredson 10 1,873 04-02-2024, 02:56 AM
Last Post: SMcNeill

Forum Jump:


Users browsing this thread: 1 Guest(s)