Jump to content
Alexxander

UTF-8 encoding ? !! \u2019 \u2013 \u2018

Recommended Posts

Hello

 

i have lots of text like this

 

With Viber, everyone in the world can connect. Freely. More than 516 million Viber users text, make HD-quality phone and video calls, and send photo and video messages worldwide over Wifi or 3G - for free.* Viber Out can be used to make calls to non-Viber mobile and landline numbers at low rates. Viber is available for many smartphones and platforms. Viber is compatible with and optimized for Android tablets! Use Viber on your tablet and phone simultaneously.\nOn Viber, your phone number is your ID. The app syncs with your mobile contact list, automatically detecting which of your contacts have Viber. \n\n\u2022 Message your friends\n\u2022 Make free phone and video calls with HD sound quality\n\u2022 Share photos, video messages, voice messages, locations, stickers and emoticons\n\u2022 Download stickers and animated stickers from the Sticker Market; sort and reorder your stickers.\n\u2022 Create group messages with up to 100 participants; become an Admin and manage your group chats \u2013 edit info and delete participants\n\u2022 Follow Public Chats \u2013 get on the inside with your favorite personalities; watch their conversations unfold in real-time, \u2018like\u2019 comments and share multi-media content\n\u2022 Play games with Viber characters, Violet and Legcat; see how many coins you can earn\n\u2022 Android Wear support \u2013 send and receive messages from your watch\n\u2022 Push notifications guarantee that you never miss a message or call, even when Viber is off\n\u2022 Integration with native contact list for calls and messages\n\u2022 Support for the Viber Desktop application on Windows and Mac\n\nLocalized to: Arabic, Catalan, Chinese (SP), Chinese (TR), Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hebrew, Hindi, Hungarian, Indonesian, Italian, Japanese, Korean, Malay, Norwegian, Polish, Portuguese (BR), Portuguese (PT), Romanian, Russian, Slovak, Spanish, Swedish, Tagalog, Thai, Turkish, Ukrainian and Vietnamese\nViber is completely free with no advertising. \nWe value your privacy. \n\nFollow us for updates and news:\nFacebook - http:\/\/facebook.com\/viber\nTwitter - http:\/\/twitter.com\/viber\n\n(*) Network data charges may apply\n\n\n\n\n\n\n\n\n\n

i have no idea what does this \u stuff means, after googling it i found that it is some sort of utf encoding

 

how could i write this text to a file without loosing any characters and getting rid of \u  ?

 

 

 

EDIT: after more digging i found that i need "Converting Unicode Entities to Unicode Text" any ideas hoe to do that with autoit ?

Edited by Alexxander

Share this post


Link to post
Share on other sites

I am not sure that you can convert this text because it is already formatted as ansi. You could use StringRegExpReplace to replace the unwanted characters. I made a simple one that gets rid of most of the annoying ones, not just the \u. The $str is the string that you posted.

$str = "With Viber, everyone in the world can connect. Freely. More than 516 million Viber users text, make HD-quality phone and video calls, and send photo and video messages worldwide over Wifi or 3G - for free.* Viber Out can be used to make calls to non-Viber mobile and landline numbers at low rates. Viber is available for many smartphones and platforms. Viber is compatible with and optimized for Android tablets! Use Viber on your tablet and phone simultaneously.\nOn Viber, your phone number is your ID. The app syncs with your mobile contact list, automatically detecting which of your contacts have Viber. \n\n\u2022 Message your friends\n\u2022 Make free phone and video calls with HD sound quality\n\u2022 Share photos, video messages, voice messages, locations, stickers and emoticons\n\u2022 Download stickers and animated stickers from the Sticker Market; sort and reorder your stickers.\n\u2022 Create group messages with up to 100 participants; become an Admin and manage your group chats \u2013 edit info and delete participants\n\u2022 Follow Public Chats \u2013 get on the inside with your favorite personalities; watch their conversations unfold in real-time, \u2018like\u2019 comments and share multi-media content\n\u2022 Play games with Viber characters, Violet and Legcat; see how many coins you can earn\n\u2022 Android Wear support \u2013 send and receive messages from your watch\n\u2022 Push notifications guarantee that you never miss a message or call, even when Viber is off\n\u2022 Integration with native contact list for calls and messages\n\u2022 Support for the Viber Desktop application on Windows and Mac\n\nLocalized to: Arabic, Catalan, Chinese (SP), Chinese (TR), Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hebrew, Hindi, Hungarian, Indonesian, Italian, Japanese, Korean, Malay, Norwegian, Polish, Portuguese (BR), Portuguese (PT), Romanian, Russian, Slovak, Spanish, Swedish, Tagalog, Thai, Turkish, Ukrainian and Vietnamese\nViber is completely free with no advertising. \nWe value your privacy. \n\nFollow us for updates and news:\nFacebook - http:\/\/facebook.com\/viber\nTwitter - http:\/\/twitter.com\/viber\n\n(*) Network data charges may apply\n\n\n\n\n\n\n\n\n\n"

$str = StringRegExpReplace($str, "(\\n\\u2022|\\u2013|\\u2019|\\u2018|\\n|\\)", "")

MsgBox(0, "", $str)

 


RAID Calculator | Software Installer

The truth has been suppressed since the dawn of time.

Share this post


Link to post
Share on other sites
$string = "With Viber, everyone in the world can connect. Freely. More than 516 million Viber users text, make HD-quality phone and video calls, and send photo and video messages worldwide over Wifi or 3G - for free.* Viber Out can be used to make calls to non-Viber mobile and landline numbers at low rates. Viber is available for many smartphones and platforms. Viber is compatible with and optimized for Android tablets! Use Viber on your tablet and phone simultaneously.\nOn Viber, your phone number is your ID. The app syncs with your mobile contact list, automatically detecting which of your contacts have Viber. \n\n\u2022 Message your friends\n\u2022 Make free phone and video calls with HD sound quality\n\u2022 Share photos, video messages, voice messages, locations, stickers and emoticons\n\u2022 Download stickers and animated stickers from the Sticker Market; sort and reorder your stickers.\n\u2022 Create group messages with up to 100 participants; become an Admin and manage your group chats \u2013 edit info and delete participants\n\u2022 Follow Public Chats \u2013 get on the inside with your favorite personalities; watch their conversations unfold in real-time, \u2018like\u2019 comments and share multi-media content\n\u2022 Play games with Viber characters, Violet and Legcat; see how many coins you can earn\n\u2022 Android Wear support \u2013 send and receive messages from your watch\n\u2022 Push notifications guarantee that you never miss a message or call, even when Viber is off\n\u2022 Integration with native contact list for calls and messages\n\u2022 Support for the Viber Desktop application on Windows and Mac\n\nLocalized to: Arabic, Catalan, Chinese (SP), Chinese (TR), Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hebrew, Hindi, Hungarian, Indonesian, Italian, Japanese, Korean, Malay, Norwegian, Polish, Portuguese (BR), Portuguese (PT), Romanian, Russian, Slovak, Spanish, Swedish, Tagalog, Thai, Turkish, Ukrainian and Vietnamese\nViber is completely free with no advertising. \nWe value your privacy. \n\nFollow us for updates and news:\nFacebook - http:\/\/facebook.com\/viber\nTwitter - http:\/\/twitter.com\/viber\n\n(*) Network data charges may apply\n\n\n\n\n\n\n\n\n\n"
$string = StringReplace($string, '\n', @CRLF)
$string = StringReplace($string, '\/', '/')
$string = Execute('"' & StringRegExpReplace($string, '\\u(\d\d\d\d)', '" & Chr($1) & "') & '"')

 


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites
$string = "With Viber, everyone in the world can connect. Freely. More than 516 million Viber users text, make HD-quality phone and video calls, and send photo and video messages worldwide over Wifi or 3G - for free.* Viber Out can be used to make calls to non-Viber mobile and landline numbers at low rates. Viber is available for many smartphones and platforms. Viber is compatible with and optimized for Android tablets! Use Viber on your tablet and phone simultaneously.\nOn Viber, your phone number is your ID. The app syncs with your mobile contact list, automatically detecting which of your contacts have Viber. \n\n\u2022 Message your friends\n\u2022 Make free phone and video calls with HD sound quality\n\u2022 Share photos, video messages, voice messages, locations, stickers and emoticons\n\u2022 Download stickers and animated stickers from the Sticker Market; sort and reorder your stickers.\n\u2022 Create group messages with up to 100 participants; become an Admin and manage your group chats \u2013 edit info and delete participants\n\u2022 Follow Public Chats \u2013 get on the inside with your favorite personalities; watch their conversations unfold in real-time, \u2018like\u2019 comments and share multi-media content\n\u2022 Play games with Viber characters, Violet and Legcat; see how many coins you can earn\n\u2022 Android Wear support \u2013 send and receive messages from your watch\n\u2022 Push notifications guarantee that you never miss a message or call, even when Viber is off\n\u2022 Integration with native contact list for calls and messages\n\u2022 Support for the Viber Desktop application on Windows and Mac\n\nLocalized to: Arabic, Catalan, Chinese (SP), Chinese (TR), Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hebrew, Hindi, Hungarian, Indonesian, Italian, Japanese, Korean, Malay, Norwegian, Polish, Portuguese (BR), Portuguese (PT), Romanian, Russian, Slovak, Spanish, Swedish, Tagalog, Thai, Turkish, Ukrainian and Vietnamese\nViber is completely free with no advertising. \nWe value your privacy. \n\nFollow us for updates and news:\nFacebook - http:\/\/facebook.com\/viber\nTwitter - http:\/\/twitter.com\/viber\n\n(*) Network data charges may apply\n\n\n\n\n\n\n\n\n\n"
$string = StringReplace($string, '\n', @CRLF)
$string = StringReplace($string, '\/', '/')
$string = Execute('"' & StringRegExpReplace($string, '\\u(\d\d\d\d)', '" & Chr($1) & "') & '"')

 

​thank you for your simple solution ...

but this way i loosed the symbols 

ex: 

\u2022

 

this is a bullet symbol ""

 

any other ideas ?

Share this post


Link to post
Share on other sites

Oh sorry, it was a typo. Chr($1) make that ChrW(0x$1)

Edited by jchd

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

Bro i'am facing a problem  with this text using your edited code

 

The incredible new Dungeon Crawler taking the world by storm! Over 10 million downloads worldwide, with all new exciting content now available! Grow your character and restore the cosmic balance in an exciting free-to-play online adventure! AppleTell \u2013 named \u201cBest iOS Game of E3 2014\u201d\n\nTouchArcade \u2013 \u201cTaichi Panda has all the necessary components that make up a great hack 'n slash action game.\u201d\n\n148Apps \u2013 \u201cThe game looks like it has some pretty nice graphics and fast play style.\u201d\n\n==Features==\n\nA Stunning Fantasy Adventure\n\nEnter a world of goblins, bandits, and pandas as you adventure through graphically stunning maps in full 3D environments. Bash your way to the center of the mystery with a fast and fluid animation style built on full-body motion capture.\n\nHack \u2018n Slash Action\n\nFight through hordes of enemies with a fast-paced combat system. Use a mixture of speed, strength and skill, combining aerial attacks and combo moves to devastate the enemy. Explore twisting labyrinths, avoid precarious traps, and defeat powerful bosses!\n\nUpgrade Everything\n\nLevel up your character to unlock powerful new abilities. Upgrade and refine your gear to bolster your power, and unleash elemental magic through ancient runes. Develop your Pets, special battle companions with their own unique progression and skills.\n\nPlay in Real-time with Friends\n\nPlay in real-time multiplayer with friends and strangers. Become the ultimate Taichi champion with PvP arenas and battlefields. Team up with fellow adventurers in group dungeons to face off against formidable Bosses. Form Guilds with friends and compatriots, and expand your territory in Guild vs Guild war mode!\n\n==Connect==\n\nVisit our official site to learn more about Taichi Panda: http:\/\/panda.snail.com\/en \nJoin the Taichi Panda community and learn more on Facebook and our official Forum \nFacebook Page: https:\/\/www.facebook.com\/TaichiPandaEN \nCommunity Forum: http:\/\/pandabbs.snail.com\/\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n

Any ideas ? 

Share this post


Link to post
Share on other sites

Jeez, I apologize for not drinking a second coffee for the second eye!

$string = "The incredible new Dungeon Crawler taking the world by storm! Over 10 million downloads worldwide, with all new exciting content now available! Grow your character and restore the cosmic balance in an exciting free-to-play online adventure! AppleTell \u2013 named \u201cBest iOS Game of E3 2014\u201d\n\nTouchArcade \u2013 \u201cTaichi Panda has all the necessary components that make up a great hack 'n slash action game.\u201d\n\n148Apps \u2013 \u201cThe game looks like it has some pretty nice graphics and fast play style.\u201d\n\n==Features==\n\nA Stunning Fantasy Adventure\n\nEnter a world of goblins, bandits, and pandas as you adventure through graphically stunning maps in full 3D environments. Bash your way to the center of the mystery with a fast and fluid animation style built on full-body motion capture.\n\nHack \u2018n Slash Action\n\nFight through hordes of enemies with a fast-paced combat system. Use a mixture of speed, strength and skill, combining aerial attacks and combo moves to devastate the enemy. Explore twisting labyrinths, avoid precarious traps, and defeat powerful bosses!\n\nUpgrade Everything\n\nLevel up your character to unlock powerful new abilities. Upgrade and refine your gear to bolster your power, and unleash elemental magic through ancient runes. Develop your Pets, special battle companions with their own unique progression and skills.\n\nPlay in Real-time with Friends\n\nPlay in real-time multiplayer with friends and strangers. Become the ultimate Taichi champion with PvP arenas and battlefields. Team up with fellow adventurers in group dungeons to face off against formidable Bosses. Form Guilds with friends and compatriots, and expand your territory in Guild vs Guild war mode!\n\n==Connect==\n\nVisit our official site to learn more about Taichi Panda: http:\/\/panda.snail.com\/en \nJoin the Taichi Panda community and learn more on Facebook and our official Forum \nFacebook Page: https:\/\/www.facebook.com\/TaichiPandaEN \nCommunity Forum: http:\/\/pandabbs.snail.com\/\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
$string = StringReplace($string, '\n', @CRLF)
$string = StringReplace($string, '\/', '/')
$string = Execute('"' & StringRegExpReplace($string, '\\u([[:xdigit:]]{4})', '" & ChrW(0x$1) & "') & '"')

 


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

All you may now encounter are different escapes, like \r \t or similar. Now the \uxxxx are correctly changed into the corresponding Unicode character. Once again sorry for not giving my previous answers enough attention.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

Of course just replacing the \u with &#x and ending the code point with ; will also result in the correct char being displaied in the html - try:

<html>
<head>
<title></title>
</head>
<body>
&#x2022;<br>
&#x201d;
</body>
</html>

 

Edited by Jury

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By AXLE
      I am trying to find information on using UTF-8 Strings in AutoIt. After searching extensively I cannot find anything conclusive on this topic. What I need to do is FileRead() into a String variable(or Array) and keep the UTF-8 Encoding. Some articles, and even Help documents on FileOpen() suggest that AutoIT (Current Versions) can read and store UTF-8 internally but my tests on reading a test web page containing UTF-8 encoded characters into a variable fails.
      Does/Can AutoIt use Strings Encoded as UTF-8, and if so how ?
      If Not does anyone know of a UDF, or a C/Win-API routine to allow to use a UTF-8 Array in AutoIt ?
      What does AutoIt use internally for Strings ? Is it converting the UTF-8 file to UCS-2 String in the Variable ?
      The following is an example which fails for me.
      ;UTF-8 Tests #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> ;https://www.w3.org/2001/06/utf-8-test/UTF-8-demo.html ;Also all checked in Notepad++ UTF-8 Encoding (Many Characters are scrambled) Local $sFile1 = "UTF-8 test file.htm"; 414 Lines | 76,412 characters. "UTF-8 test file.htm" = "/UTF-8-demo.html" Local $sFile2 = "test2.html" Local $hfile1 = FileOpen($sFile1, BitOr($FO_READ, $FO_UTF8_NOBOM)) If @error Then MsgBox($MB_SYSTEMMODAL, "FileOpen1", "Value of @error is: " & @error & @CRLF & "Value of @extended is: " & @extended) EndIf Local $sAm_I_UFT_8 = FileRead($hfile1, -1);Does not appear to read UTF-8 characters correctly from the "UTF-8 test file.htm" If @error Then MsgBox($MB_SYSTEMMODAL, "FileRead", "Value of @error is: " & @error & @CRLF & "Value of @extended is: " & @extended) EndIf FileClose($hfile1) Local $sAm_I_Still_UTF_8 = $sAm_I_UFT_8 ;Are these two strings stored internaly as UTF-8 ? If @error Then MsgBox($MB_SYSTEMMODAL, "String=String", "Value of @error is: " & @error & @CRLF & "Value of @extended is: " & @extended) EndIf Local $iStrLen1 = StringLen($sAm_I_UFT_8) Local $iStrLen2 = StringLen($sAm_I_Still_UTF_8) MsgBox($MB_SYSTEMMODAL, "String Lenght of $sAm_I_UFT_8", $iStrLen1); 414 Lines | 70,174 characters MsgBox($MB_SYSTEMMODAL, "String Lenght of $sAm_I_Still_UTF_8", $iStrLen2); 414 Lines | 70,174 characters Local $hfile2 = FileOpen($sFile2, BitOR($FO_OVERWRITE, $FO_BINARY)) If @error Then MsgBox($MB_SYSTEMMODAL, "FileOpen2", "Value of @error is: " & @error & @CRLF & "Value of @extended is: " & @extended) EndIf FileWrite($hfile2, $sAm_I_Still_UTF_8) ;If $sAm_I_Still_UTF_8 is actual UTF-8 it should be an exact copy of the original "UTF-8 test file.htm" If @error Then MsgBox($MB_SYSTEMMODAL, "FileOpen2", "Value of @error is: " & @error & @CRLF & "Value of @extended is: " & @extended) EndIf FileClose($hfile2)  
    • By Jibberish
      I need to read log files into an array to search for errors. However when I display the array I get garbage or "chinese characters". Our developers say they are using UTF-8, but FileGetEncoding says the logs are "2048" or $FO_UTF16_BE_NOBOM (2048) = Use Unicode UTF16 Big Endian (without BOM) from the Encoding codes in FileOpen().
      There is an app called Detenc that detects the encoding used by files. You have to guess, but it returns correctly when I set the Encoder for UTF-8. I understand Encoding is not etched in stone, but the first character of the file is a capital B, using HxD Hex Editor.
      I even have another  topic here about running PowerShell to reencode the file so AutoIt will store the file properly in the array - See:
      So I am trying to figure out why AutoIt thinks my logs are not UTF-8.
      Here is sample code:
      #include <array.au3> #include <File.au3> Local $aRetArrayFile _FileReadToArray("C:\Logs\Myplayer1.log", $aRetArrayFile) _ArrayDisplay($aRetArrayFile) I won't post the results as it is illegible, but I did attach a screenshot of the _ArrayDisplay results, and this is the first line of the Log file:
      BANNER 10/10/2017 15:56:00 ====================================================================== And the Hex from the beginning of the file:
      42 41 4E 4E 45 52 20 31 30 2F 31 30 2F 32 30 31 37 20 31 34 3A 33 31 3A 33 35 20 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 0D 0A 42 41 4E 4E 45 52 20 So I don't understand why AutoIt thinks the file is UTF16 BE.
      If I can get the Powershell script running, I have a workaround.
      BTW none of my other arrays display as garbage, just the log files.
      Weird.
      Rereading my post, what seems to be missing is the question. I guess my question is, does anyone know why these logs are being displayed incorrectly?
      Cheers
      Jibs

    • By Jibberish
      Hi all,
      I need to read a log file into an array, but the log file is encoded as $FO_UTF16_BE_NOBOM (2048) = Use Unicode UTF16 Big Endian (without BOM) per FileGetEncoding (it returns 2048).
      I have searched how to convert these log files to UTF-8 and finally found a Powershell command. Since then I have been racking my brain trying to get the function to work. The command itself works from a Powerscript prompt:
      C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command Get-Content C:\Logs\Myplayer_10-10-17-02-31.log | Set-Content -Encoding utf8 C:\Logs\Myplayer1.log This is my sandbox;
      #include <array.au3> #include <File.au3> Local $aArrayLogFile Local $sLogDir = "C:\Logs\" Local $sLogFile = "Myplayer_10-10-17-02-31.log" Local $sConvertedLog = "ConvertedLog.log" Local $sLogDirFile = $sLogDir&$sLogFile RunWait("C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command Get-Content "&$sLogDirFile&" | Set-Content -Encoding utf8 "&$sConvertedLog,$sLogDir) _FileReadToArray($sLogDirFile, $aArrayLogFile) _ArrayDisplay($aArrayLogFile) Also tried
      RunWait("C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command Get-Content "&$sLogDirFile&" | Set-Content -Encoding utf8 "&$sConvertedLog,$sLogDir) and
      ShellExecuteWait("C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"," -Command Get-Content "&$sLogDirFile&" | Set-Content -Encoding utf8 "&$sConvertedLog,$sLogDir) Tried without -Command and a bunch of other parameters that were sprinkled throughout the internet from people trying to get this to work.
      Thanks
      Jibs
    • By rootx
      I need help with unicode char ü I get some text from online json but if try to read 4 example Zürich I heave  Zürich.
      How can I convert with autoit unicode to a clear character readable? thx
×
×
  • Create New...