mandaka Posted February 3, 2019 Posted February 3, 2019 Hello everyone, I have a problem with Autoit, specially UTF8. I use a website as API for my project and the website gives me strings in UTF8 like the word Šušanj. AutoIt cant display the string, my output is: Å uÅ¡anj. In HTML i can use for this problem <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> What can I use in AutoIt that Autoit handle my string correctly? Sorry for my bad english. Thanks for your help.
Nine Posted February 3, 2019 Posted February 3, 2019 Can you put up your code, cause I msgbox this Šušanj without problem. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
mandaka Posted February 3, 2019 Author Posted February 3, 2019 $HTMLSource_GET_FIRST_DATA = _INetGetSource("LINK") $HTMLSource_GET_FIRST_DATA = StringReplace($HTMLSource_GET_FIRST_DATA, '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />', "") Local $Array_mit_Hoteldaten = _StringExplode($HTMLSource_GET_FIRST_DATA, "#+#+#+#+#+#+#+#", 0) Local $sql_id = $Array_mit_Hoteldaten[0]; Local $sql_link = $Array_mit_Hoteldaten[1]; Local $sql_ueberschrift = $Array_mit_Hoteldaten[2] Local $sql_hotel1 = $Array_mit_Hoteldaten[3]; Local $sql_hotel2 = $Array_mit_Hoteldaten[4]; Local $sql_hotel3 = $Array_mit_Hoteldaten[5]; Local $sql_hotel4 = $Array_mit_Hoteldaten[6]; Local $sql_hotel5 = $Array_mit_Hoteldaten[7]; Local $sql_hotel6 = $Array_mit_Hoteldaten[8]; Local $sql_hotel7 = $Array_mit_Hoteldaten[9]; Local $sql_hotel8 = $Array_mit_Hoteldaten[10]; Local $sql_hotel9 = $Array_mit_Hoteldaten[11]; Local $sql_hotel10 = $Array_mit_Hoteldaten[12]; Local $sql_hotel11 = $Array_mit_Hoteldaten[13]; Local $sql_hotel12 = $Array_mit_Hoteldaten[14]; All $sql - Strings have the problem.
Nine Posted February 3, 2019 Posted February 3, 2019 Put a msgbox before the explode and after one of the $sql that doesn't work. Verify what type of encoding you got in scite (under file menu). “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
mandaka Posted February 3, 2019 Author Posted February 3, 2019 Both Msgboxes shows me Šušanj. My encoding type is UTF8. I tried it with every option before. I have to say, that when I write the word directly into AutoIt it works, but not when I crawl it via _INetGetSource
mandaka Posted February 3, 2019 Author Posted February 3, 2019 It works now. I changed $HTMLSource_GET_FIRST_DATA = BinaryToString(InetRead("http://www.9ym.de/dr/yt/",1),4) $HTMLSource_GET_FIRST_DATA = StringRegExpReplace($HTMLSource_GET_FIRST_DATA,"\A.+?:","")
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now