How to convert Unicode Hebrew is displayed in VBScript as Gibberish?

>I am using vbscript and WinHttp.WinHttpRequest.5.1 object to collect information from HEBREW (WINDOWS-1255 / UTF-8 encoding) website.

For example :

Set objWinHttp = CreateObject("WinHttp.WinHttpRequest.5.1")
...
'writes the file as unicode (can't use Ascii)
Set Fileout = FSO.CreateTextFile("c:\temp\myfile.xml", true, true)

....
Fileout.WriteLine(objWinHttp. responsetext)

>When viewing files in Notepad/Notepad, I regard Hebrew as Gibrish / Gibberish.
For example:
äìëåú – äøáàáøäíéåñó – îåøùú
>Me A vbscript function is needed to return Hebrew correctly, the function should be similar to the following http://www.pixiesoft.com/flip/ Select the second radio button and press the convert button, you will see Hebrew correctly Incoming words.

Your script correctly obtains the byte stream and saves it as is. No problem. < p>

Your problem is that the local text editor does not know that it should read the file as cp1255, so it will try the default value on your cp1252 machine. You cannot save the file as cp1252 locally , So Notepad will read it correctly, because cp1252 does not contain any Hebrew characters.

What will eventually read the file or byte stream and need to pick up Hebrew correctly? If it does not support cp1255, you need to find an encoding supported by the tool and convert the cp1255 string to that encoding. It is recommended that you try UTF-8 or UTF-16LE (encoding Windows is misleadingly called’Unicode’.)

Converting text between encodings in VBScript/JScript can be done as a side effect of ADODB streaming. Please see the example in this answer.

>I am working on Use vbscript and WinHttp.WinHttpRequest.5.1 object to collect information from HEBREW (WINDOWS-1255 / UTF-8 encoding) website.

For example:

Set objWinHttp = CreateObject("WinHttp.WinHttpRequest.5.1")
...
'writes the file as unicode (can't use Ascii)
Set Fileout = FSO.CreateTextFile(" c:\temp\myfile.xml", true, true)

....
Fileout.WriteLine(objWinHttp.responsetext)

>In Notepad/ When viewing files in Notepad, I regard Hebrew as Gibrish / Gibberish.
For example:
äìëåú – äøáàáøäíéåñó – îåøùú
>I need a vbscript function to return Hebrew correctly. This function It should be similar to the following http://www.pixiesoft.com/flip/ Select the second radio button and press the convert button, you will see Hebrew correctly.

Your script gets the byte stream correctly and saves it as is. No problem.

Your problem is that the local text editor doesn’t know that it should read the file as cp1255, so it will try the default on your cp1252 machine. You cannot save the file as cp1252 locally, so Notepad will read it correctly because cp1252 does not contain any Hebrew characters.

What will eventually read the file or byte stream and need to pick up Hebrew correctly? If it does not support cp1255, you need to find an encoding supported by the tool and convert the cp1255 string to that encoding. It is recommended that you try UTF-8 or UTF-16LE (encoding Windows is misleadingly called’Unicode’.)

Converting text between encodings in VBScript/JScript can be done as a side effect of the ADODB stream. Please refer to the example in this answer.

Leave a Comment

Your email address will not be published.