Webtextfield encoding issue?

Hello all,

A webtext field is populated with this data:
0025_38B9_61B1_71FC. WD-WXG1A968Z4CL

but instead, it displays this data.
0025_38B9_61B1_71FC.

WD-WXG1A968Z4CL

I think the problem is the encoding but I think it is a bit weird because the same code used to display in a windows app displays properly.

If I am right and it is a text encoding issue, how do I correct this? Also, in debug mode, the IDE displays correctly as well.

Thanks all.
Tim

Not encoding. I’m guessing that you have two carriage returns in the middle.

Hi Greg,
At first glance, that is what I thought too. But here again, same code as what is used in a desktop app.

This is the code used:

[code]sh.Execute(“wmic DISKDRIVE GET SerialNumber”)
HDSerial = Trim(NthField(sh.Result, “SerialNumber”,2))

fldHD_Serial.Text = HDSerial

[/code]

In the debugger it shows the local variable HDSerial as 0025_38B9_61B1_71FC. WD-WXG1A968Z4CL
How are spaces, or what appears as spaces, handled in a web app?

Tim

[quote=340634:@Tim Seyfarth]Hello all,

A webtext field is populated with this data:
0025_38B9_61B1_71FC. WD-WXG1A968Z4CL

but instead, it displays this data.
0025_38B9_61B1_71FC.

WD-WXG1A968Z4CL

I think the problem is the encoding but I think it is a bit weird because the same code used to display in a windows app displays properly.

If I am right and it is a text encoding issue, how do I correct this? Also, in debug mode, the IDE displays correctly as well.

Thanks all.
Tim[/quote]
This is not text encoding. In HTML,
means line feed.

In spite of Desktop and Web using the same language, underlying code is VERY different. So what works in Desktop may sometimes not in Xojo Web.

[quote=340647:@Tim Seyfarth]Hi Greg,
At first glance, that is what I thought too. But here again, same code as what is used in a desktop app.

This is the code used:

[code]sh.Execute(“wmic DISKDRIVE GET SerialNumber”)
HDSerial = Trim(NthField(sh.Result, “SerialNumber”,2))

fldHD_Serial.Text = HDSerial

[/code]

In the debugger it shows the local variable HDSerial as 0025_38B9_61B1_71FC. WD-WXG1A968Z4CL
How are spaces, or what appears as spaces, handled in a web app?

Tim[/quote]
Look at the binary representation. See if there are two chr(10) or chr(13) chars there.

Also, make sure the string’s encoding is UTF8.

Hi Greg,
I tried this code, but same result - so not an encoding issue.

Dim sHDSerial As String
sHDSerial = HDSerial.ConvertEncoding(Encodings.UTF8)

fldHD_Serial.Text = sHDSerial // HDSerial

It was not a Chr(10) but it was a chr(13).

Thanks for the help!