Unicode conversion

  • Thread starter Thread starter Bill Nguyen
  • Start date Start date
B

Bill Nguyen

Below is the "Code" portion in MS Frontpage. On the design screen is what I
typed in using Unicode. I need to be able to convert data from one format to
another from within a .NET app

1. Is there any util/addon that can do this?
2. Sample coding to do it on our own

Thanks

Bill
------------------


Code screen:
<body>

<p>Bỏ phiếu</p>
<p>Góp ý</p>
<p>&nbsp;</p>
<p>Phiếu bầu</p>
<p>Kết quả thăm dò:</p>
<p>Tổng số phiếu:</p>
<p>Xem kết quả</p>

</body>

----------------
Design:
B? phi?u
Góp ý



Phi?u b?u

K?t qu? tham dò:

T?ng s? phi?u:

Xem k?t qu?
 
Cor;
Thanks for your tip.
However, it doesn't work at all trying to use the sample in the link.
Am I using the wrong syntax?

Thanks again

Bill
----------
Imports system

Imports System.Web

Imports System.IO

Imports System.Web.HttpUtility

Imports System.Net

Public Class frmHTMLutil

Private Sub btnHtmlDecode_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnHtmlDecode.Click

Dim s As String = "Phiếu bầu"

Dim op As TextWriter

HtmlDecode(s, op)

End Sub

End Class
 
Bill,

It works fine for me assuming that it has to be Phiếu bầu which I surely could not have typed by hand.

\\\
Dim s As String = "Phiếu bầu"
Dim op As String
op = Web.HttpUtility.HtmlDecode(s)
///

I hope this helps,

Cor
 
Dear Cor;
I figured it out.
Still have to read into a string then decode.
I ran into a different problem though.

The encoded text was read back to it's original format perfectly using MS Frontpage.
However, still having a lot of garbage using HtmlDecode.

I'm thinking of reading the text into bytes, then decode from bytes back to its original format.

Any algorithm that can do this properly?

Thanks

Bill
Bill,

I would not even try if there are more possibillties, I just would do that now I know how it goes.
The time I win with looking for that I can probably never win again by using it in another way.

This is about nanoseconds, if it is a big file, than the sending over Internet will for sure still years take so much time that nobody will see it.

:-)

Cor
"Bill Nguyen" <[email protected]> schreef in bericht Dear Cor;

Yes, "Phiếu bầu " that is :-)

Now instead of a string, can s be a text file instead? Do I have to read the text file into a string before the conversion or httpUtility can read a file?

Thanks a million.

Bill



Bill,

It works fine for me assuming that it has to be Phiếu bầu which I surely could not have typed by hand.

\\\
Dim s As String = "Phiếu bầu"
Dim op As String
op = Web.HttpUtility.HtmlDecode(s)
///

I hope this helps,

Cor
 
Bill,

A unicode is two bytes, so converting it to that will in my idea not help you.

I really did only that HTMLDecode.

What I can think about that my code table in my system is more confirm those characters.
Although the characters are surely not used in my language.

http://www.vb-tips.com/dbPages.aspx?ID=cca7e08a-9580-42b3-beff-76c81839e6c9

Cor
"Bill Nguyen" <[email protected]> schreef in bericht Dear Cor;
I figured it out.
Still have to read into a string then decode.
I ran into a different problem though.

The encoded text was read back to it's original format perfectly using MS Frontpage.
However, still having a lot of garbage using HtmlDecode.

I'm thinking of reading the text into bytes, then decode from bytes back to its original format.

Any algorithm that can do this properly?

Thanks

Bill
Bill,

I would not even try if there are more possibillties, I just would do that now I know how it goes.
The time I win with looking for that I can probably never win again by using it in another way.

This is about nanoseconds, if it is a big file, than the sending over Internet will for sure still years take so much time that nobody will see it.

:-)

Cor
"Bill Nguyen" <[email protected]> schreef in bericht Dear Cor;

Yes, "Phiếu bầu " that is :-)

Now instead of a string, can s be a text file instead? Do I have to read the text file into a string before the conversion or httpUtility can read a file?

Thanks a million.

Bill



Bill,

It works fine for me assuming that it has to be Phiếu bầu which I surely could not have typed by hand.

\\\
Dim s As String = "Phiếu bầu"
Dim op As String
op = Web.HttpUtility.HtmlDecode(s)
///

I hope this helps,

Cor
 
Cor;
Thanks

I will look into it!

Bill
Bill,

A unicode is two bytes, so converting it to that will in my idea not help you.

I really did only that HTMLDecode.

What I can think about that my code table in my system is more confirm those characters.
Although the characters are surely not used in my language.

http://www.vb-tips.com/dbPages.aspx?ID=cca7e08a-9580-42b3-beff-76c81839e6c9

Cor
"Bill Nguyen" <[email protected]> schreef in bericht Dear Cor;
I figured it out.
Still have to read into a string then decode.
I ran into a different problem though.

The encoded text was read back to it's original format perfectly using MS Frontpage.
However, still having a lot of garbage using HtmlDecode.

I'm thinking of reading the text into bytes, then decode from bytes back to its original format.

Any algorithm that can do this properly?

Thanks

Bill
Bill,

I would not even try if there are more possibillties, I just would do that now I know how it goes.
The time I win with looking for that I can probably never win again by using it in another way.

This is about nanoseconds, if it is a big file, than the sending over Internet will for sure still years take so much time that nobody will see it.

:-)

Cor
"Bill Nguyen" <[email protected]> schreef in bericht Dear Cor;

Yes, "Phiếu bầu " that is :-)

Now instead of a string, can s be a text file instead? Do I have to read the text file into a string before the conversion or httpUtility can read a file?

Thanks a million.

Bill



Bill,

It works fine for me assuming that it has to be Phiếu bầu which I surely could not have typed by hand.

\\\
Dim s As String = "Phiếu bầu"
Dim op As String
op = Web.HttpUtility.HtmlDecode(s)
///

I hope this helps,

Cor
 
Back
Top