Correggi visualizzazione a capo editor Okuma

This commit is contained in:
Livio Merola
2026-07-28 08:18:03 +02:00
parent 57ff70bdf4
commit 807e4f8f3d
9 changed files with 23 additions and 38 deletions
+10 -25
View File
@@ -443,24 +443,26 @@ Public Class Form1
Private Shared Function ToVisibleControlText(content As String) As String
Dim builder As New StringBuilder(content.Length)
For Each ch In content
Dim i = 0
While i < content.Length
Dim ch = content(i)
Select Case AscW(ch)
Case &H0
builder.Append("[NUL]")
Case &HA
builder.Append("[LF]")
builder.Append(Environment.NewLine)
Case &HD
builder.Append("[CR]")
If i + 1 < content.Length AndAlso content(i + 1) = ControlChars.Lf Then
i += 1
End If
builder.Append(Environment.NewLine)
Case &H12
builder.Append("[DC2]")
Case &H14
builder.Append("[DC4]")
Case 1 To 8, 11, 12, 14 To 17, 19, 21 To 31
builder.Append($"[0x{AscW(ch):X2}]")
Case Else
builder.Append(ch)
End Select
Next
i += 1
End While
Return builder.ToString()
End Function
@@ -489,15 +491,6 @@ Public Class Form1
Private Shared Function TryParseControlToken(token As String, ByRef controlChar As Char) As Boolean
Select Case token.Trim().ToUpperInvariant()
Case "NUL"
controlChar = ChrW(&H0)
Return True
Case "LF"
controlChar = ControlChars.Lf
Return True
Case "CR"
controlChar = ControlChars.Cr
Return True
Case "DC2"
controlChar = ChrW(&H12)
Return True
@@ -506,14 +499,6 @@ Public Class Form1
Return True
End Select
If token.StartsWith("0x", StringComparison.OrdinalIgnoreCase) Then
Dim value As Integer
If Integer.TryParse(token.Substring(2), Globalization.NumberStyles.HexNumber, Globalization.CultureInfo.InvariantCulture, value) AndAlso value >= 0 AndAlso value <= 31 Then
controlChar = ChrW(value)
Return True
End If
End If
controlChar = ControlChars.NullChar
Return False
End Function
@@ -16,9 +16,9 @@
<ProductName>LMEMoxaTransfer</ProductName>
<PublisherName>Compomac SPA</PublisherName>
<SuiteName>Compomac SPA</SuiteName>
<ApplicationVersion>1.0.6.0</ApplicationVersion>
<ApplicationVersion>1.0.8.0</ApplicationVersion>
<UpdateRequired>true</UpdateRequired>
<MinimumRequiredVersion>1.0.6.0</MinimumRequiredVersion>
<MinimumRequiredVersion>1.0.8.0</MinimumRequiredVersion>
<GenerateManifests>true</GenerateManifests>
<PublishSingleFile>false</PublishSingleFile>
<SelfContained>true</SelfContained>
@@ -9,7 +9,7 @@
<AssemblyTitle>LMEMoxaTransfer</AssemblyTitle>
<Company>Compomac SPA</Company>
<Authors>Livio Merola</Authors>
<Version>1.0.6.0</Version>
<Version>1.0.8.0</Version>
<ApplicationIcon>Assets\app-icon.ico</ApplicationIcon>
<StartupObject>Sub Main</StartupObject>
<UseWindowsForms>true</UseWindowsForms>