Jump to content

Erroneous characters in page


Recommended Posts

Instead of characters (ąęół) gives ��� in page

Me code :

Head Page :

<head id="ctl00_Head">
<link href="/favicon.ico" rel="shortcut icon" />
<title>
   Przyjazny dysk internetowy - Chomikuj.pl
</title>

<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
<meta content="pl" http-equiv="content-language" />
<meta id="ctl00_ChomikKeywords" name="keywords" content="chomik, udostępnić, e-dysk, upload, pliki, dysk internetowy, edysk, udostępnianie, wrzucić, zamieścić, załadować, plik, wrzucanie, umieszczanie, wstawianie, wrzuta, plików, uploadu, zamieszczanie" />
<meta id="ctl00_ChomikDescription" name="description" content="Przechowuj za darmo muzykę, filmy, dokumenty i inne pliki. W łatwy sposób udostępniaj je wszystkim znajomym!" />
<link href="http://x1.static-chomikuj.pl/res/0b81f6893c.css" rel="stylesheet" type="text/css"/>
<link href="http://x1.static-chomikuj.pl/res/1c8d2e79d5.css" rel="stylesheet" type="text/css"/> 
<meta name="google-site-verification" content="JE-2IN234qEwlZlHu6nW3gaLKG3zRMZiAs30M2PFrOE" />
<script type="text/javascript" id="cintpl_loader" src="http://x.interia.pl/inpl/inpl.intad.1.0.5.js"></script>
       
<script type="text/javascript">
    <!-- <![CDATA[
    if(!INTPL)var INTPL=function(){return "";};
    // ]]> -->
    </script>
    <!-- gH=chomikuj.pl --><!-- Begin DOTSRV -->
<script type="text/javascript">
<!-- <![CDATA[   
var pp_gemius_identifier = "d1A1NEs2uSLW49UpzRJ9woawnJ5RHQxpaCZ8Toa4EpX.s7"; 
// ]]> -->
</script>

<script type="text/javascript" src="http://interia.hit.gemius.pl/xgemius.js"></script>
<!-- End DOTSRV --><!-- GA2.1 -->

<script type="text/javascript">
<!-- <![CDATA[
var _gaq = _gaq || [];
_gaq.push(['b._setAccount', 'UA-2554597-41']);
_gaq.push(['_addOrganic', 'google.interia','q']);
_gaq.push(['b._trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
})();
// ]]> --> 
</script>

<!-- /GA2.1 --><!-- AdServer CID: INTERIA/chomikuj PID: main -->

<script type="text/javascript">
<!-- <![CDATA[
if(location.protocol.substr(0,4)=='http')document.write(unescape('%3C')+'script id="INTERIA.PL.SPECJALNE.chomikuj.main" src="'+location.protocol+'//hub.com.pl/_'+(new Date()).getTime()+'/ad.js?id=_T1VTMEtnWz3vmpPizxzOBjtPLMAd3CE33zM3czqi4H.P7/x='+screen.width+'/y='+screen.height+Inpl.Ad.getKeywords("/key=")+'" type="text/javascript"'+unescape('%3E%3C')+'/script'+unescape('%3E'));
// ]]> -->
</script>

<script type="text/javascript">
<!-- <![CDATA[
Inpl.Ad.init({'1x1':'adoceanhubpigqptqmwf','watermark':'adoceanhubmjngdrkrca','skyscraper':'adoceanhubzjengoegwz','gora_srodek':'adoceanhubwkltjlokvu','box300x250':'adoceanhubqgdickiuoe'});
if(location.hash.indexOf('#inpltesterad')>-1&&location.hash.replace(/[^0-9a-z=]/g,"").length==45){document.write(unescape('%3C')+'script id="kodmaster" src="http://reklama.interia.pl/testuj/inpltester?'+location.hash.replace(/[^0-9a-z=]/g,"")+'" type="text/javascript"'+unescape('%3E%3C')+'/script'+unescape('%3E'));}
// ]]> -->
</script>

<meta name="verify-v1" content="Vuafmf4GB0howNC8SUccaT8dA7vRdaYeb0SDxYC4Yq4=" />

<script type="text/javascript" src="http://partner.googleadservices.com/gampad/google_service.js"></script>
<script type="text/javascript">
GS_googleAddAdSenseService("ca-pub-7710918921294786");
GS_googleEnableAllServices();
</script>

<script type="text/javascript">
GA_googleAddSlot("ca-pub-7710918921294786", "chomik_strona_glowna_podwidzianymi_duzybox");
GA_googleAddSlot("ca-pub-7710918921294786", "chomik_strona_glowna_podwidzianymi_duzybox_internal");
GA_googleAddSlot("ca-pub-7710918921294786", "chomik_strona_glowna_duzybox");
</script>

<script type="text/javascript">
GA_googleFetchAds();
</script>

Me code Auto it :

;code1
_FFXPath("//input[@name='ctl00$LoginTop$LoginChomikName']", "", 9)
_FFObj("xpath.value = '" & GUICtrlRead($InputLogin) & "'")
;code2
_FFXPath("//input[@id='ctl00_LoginTop_LoginChomikPassword']", "", 9)
_FFObj("xpath.value = '" & GUICtrlRead($InputHaslo) & "'")
;code3
_FFXPath("//textarea[@id='ChatText']", "", 9)
_FFObj("xpath2.value = '" & GUICtrlRead($InputRek) & "'")
EndFunc

and html code for me code auto it

<input name="ctl00$LoginTop$LoginChomikName" type="text" id="ctl00_LoginTop_LoginChomikName" tabindex="1" class="text" style="width:145px;">


<input name="ctl00$LoginTop$LoginChomikPassword" type="password" id="ctl00_LoginTop_LoginChomikPassword" tabindex="1" class="text" onblur="topLoginRemember(event)" onkeydown="topLoginRemember(event)" style="width:90px;">

<textarea id="ChatText" onkeydown="ch.ChatControl.Send(event)" rows="3" cols="" style="width: 260px; height: 35px"></textarea>

What could be the reason?

Link to comment
Share on other sites

Your question doesn't seem very clear to me. Is the problem that when you create or modify a text file (html is mere text file) your diacritics are not recorded in UTF-8? If so, then use FileOpen with option 256 (or 128 if the consumer of the file doesn't appreciate a BOM). Then subsequent writes to this file will be UTF-8 encoded data.

Also what tools do you use to display the UTF-8 file?

If the problem is not there, please try to explain more precisely what you have (example text file and example code) while keeping your samples as simple as possible, so we can provide assistance.

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)

Link to comment
Share on other sites

English Version :

I will write in two languages, because I do not know the English language well.

When the program writes to a Notepad ąę writes well but when he writes (sends) This FireFox it loses marks ąę and displays the characters ¿½ ï ¿½ ï ¿½ ï

Give my entire code for AutoIt?

Polish Version :

Będę pisać w dwóch językach, bo nie znam język angielski dobrze.

Gdy program pisze do Notatnika pisze dobrze ąę ale gdy już pisze (wysyła) do przeglądarki FireFox to gubi znaki ąę i wyświetla się znaki ¿½ ï ¿½ ï ¿½ ï

Podać mój cały kod AutoIT ?

Link to comment
Share on other sites

Sorry for the delay to answer your question.

I believe Send() does /not/ allow you to send Unicode characters, whatever the help file says. I guess it can only send characters that you can compose either directly or using the ALT + code method.

Please try this alternative method using the clipboard. It works for me, but you need to adapt the window title to what it is for you.

#include <Clipboard.au3>

Local $test = "ąęółąĂāĢŕŁʤDŽŲĤƕƧʄɚȐϠϢϪЂѨѤҤҴӁۋऍखಊཀᇡỪỸἎℌℛ℥ℳↁ∰♔♕♖♗♘㌗"
_ClipBoard_SetData($test, $CF_UNICODETEXT)
;; here make sure the application window you want to send to is active
WinActivate("Page de d")    ; activate FireFox window (actual title depends on your language)
Send("^v")

You should see the same Unicode string displayed in your input form in Firefox (or IE).

Anyway, he most reliable way to fill a web form is to use _IE* functions (see help file).

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)

Link to comment
Share on other sites

English :

The problem is that AutoIt code so that I set it on different sides so the title page is changeable. And the text you want to send in a box, I type in the input. (I have a fairly lengthy text that contains characters so it makes no sense to change the AE [^ a / ^ e]

And while it will give _ie well filled by typing the characters?

I use translate google to translate Polish to English

Polish:

Problem jest w tym że Kod AutoIT tak ustawiłem że chodzi po rożnych stronach więc tytuł strony jest zmienny. Oraz tekst który ma wysyłać w danym oknie wpisuję w input. (Mam dość długi tekst który zawiera znaki więc nie ma sensu zmieniać ąę na [^a/^e]

A gdy dam _IE to będzie dobrze wypełniał wpisując znaki ??

Użyłem Google Translate do tłumaczenia z polskiego na angielski

Link to comment
Share on other sites

After some time searching the forum I found these links:

for an explanation about Send and ASC

for a workaround

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)

Link to comment
Share on other sites

Well pasted code? (^v) in _FFXPatch??

and a load of $inputRek ?

;GUI
    $InputRek = GUICtrlCreateInput("", 10, 50, 650, 280)
;func
Func GO()
Global $hDll = DllOpen('user32.dll')
Global $sString = $Inputrek
Global $sTemp = ClipGet()

_SendEx($sString)
ClipPut($sString)
_FFXPath("//textarea[@id='ChatText']", "", 9)
_FFObj("xpath2.value = '"('^v')"'")
ClipPut($sTemp)
DllClose($hDll)

_FFClick(_FFXPath("//a[@class='sendB']", "", 9))


Func _SendInputKB($iInputs, $pInputs, $iSize, $hDll = 'user32.dll')
    Local $aRet = DllCall($hDll, 'uint', 'SendInput', 'uint', $iInputs, 'ptr', $pInputs, 'int', $iSize)
    If @error Or Not $aRet[0] Then Return SetError(1, 0, False)
    Return SetError(0, 0, True)
EndFunc

Func _SendEx($sString)
    Local $tINPUT, $pINPUT, $iINPUT
    Local $iFlags, $iStrLen
    
    $iFlags = BitOR($KEYEVENTF_UNICODE, $KEYEVENTF_KEYUP)
    $iStrLen = StringLen($sString)
    
    $tINPUT = DllStructCreate($tagINPUT)
    $pINPUT = DllStructGetPtr($tINPUT)
    $iINPUT = DllStructGetSize($tINPUT)
    
        DllStructSetData($tINPUT, 'type', $INPUT_KEYBOARD)
        DllStructSetData($tINPUT, 'wVk', 0)
    
    For $i = 1 To $iStrLen
        DllStructSetData($tINPUT, 'dwFlags', $KEYEVENTF_UNICODE)
        DllStructSetData($tINPUT, 'wScan', AscW(StringMid($sString, $i, 1)))
        _SendInputKB(1, $pINPUT, $iINPUT, $hDll)
        
        DllStructSetData($tINPUT, 'dwFlags', $iFlags)
        _SendInputKB(1, $pINPUT, $iINPUT, $hDll)
    Next
EndFunc
EndFunc
Edited by metis
Link to comment
Share on other sites

Your code won't work. Unlike other languages like Pascal or C, AutoIt doesn't allow for local functions (functions defined inside another function).

Now (trying to understand you) if you want to read the content of an input control you need to use GUICtrlRead.

Do this to load $sString with the content of the input control whose handle is $InputRek:

$sString = GUICtrlRead($InputRek)

You need to do this every time you need to get the input control content.

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)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...