Jump to content

Work With Special Codepage


Recommended Posts

I would like to ask how to force AutoIT work with special codepage. I working with Clipboard. Before executing script Clipboard contain: ľčťňôďĽČŤŇĎ.

After executing script contain:¾èòôï¼ÈÒÏ

the script is:

$cleared = ClipGet()
ClipPut ( $cleared )
Link to comment
Share on other sites

even odder for me, coppied your "before" sample ľčťňôďĽČŤŇĎ then ran this code:

$cleared = ClipGet()
MsgBox(4096,'debug:' , '$cleared:' & $cleared);### Debug MSGBOX 
ClipPut ( $cleared )
$next = ClipGet()
MsgBox(4096,'debug:' , '$next:' & $next);### Debug MSGBOX

This shows up in both msgboxes... l(c(t(n(ôd(L(C(T(N(D( and is in the clipboard in the end.

maybe some sort of asc or chr parsing needs to be done?

"I'm not even supposed to be here today!" -Dante (Hicks)

Link to comment
Share on other sites

Even stranger: try pasting in that string of chars into this script's input box:

$a = InputBox('title', 'prompt')
For $i = 1 To StringLen($a)
  MsgBox(0, "", "Char " & $i & ": " & Asc(StringMid($a, $i, 1)))
Next

How's that for odd?

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to comment
Share on other sites

Even stranger: try pasting in that string of chars into this script's input box:

$a = InputBox('title', 'prompt')
For $i = 1 To StringLen($a)
  MsgBox(0, "", "Char " & $i & ": " & Asc(StringMid($a, $i, 1)))
Next

How's that for odd?

<{POST_SNAPBACK}>

it pasted into the input box fine for me, then started returning the asc for the chars... what oddity happened for you?

"I'm not even supposed to be here today!" -Dante (Hicks)

Link to comment
Share on other sites

it pasted into the input box fine for me, then started returning the asc for the chars...    what oddity happened for you?

<{POST_SNAPBACK}>

No, look up the ASCII letters that the code represents. You end up with the following string after re-creating the letters:

lctnônLCTND

That's a lower-case L for the first letter, not an I or 1.

The strangeness is in the fact that it not only didn't match the original, but also didn't match what you got as a result when you ran your test.

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to comment
Share on other sites

No, look up the ASCII letters that the code represents.  You end up with the following string after re-creating the letters:

lctnônLCTND

That's a lower-case L for the first letter, not an I or 1.

The strangeness is in the fact that it not only didn't match the original, but also didn't match what you got as a result when you ran your test.

<{POST_SNAPBACK}>

well, my, yes, that's odd. What are those special characters doing to autoit?

when I paste ľčťňôďĽČŤŇĎ into SciTE I get l(c(t(n(ôd(L(C(T(N(D( when I paste into other apps, it's the same as it goes in...

:ph34r: This is beyond me.

"I'm not even supposed to be here today!" -Dante (Hicks)

Link to comment
Share on other sites

Even stranger: try pasting in that string of chars into this script's input box:

$a = InputBox('title', 'prompt')
For $i = 1 To StringLen($a)
  MsgBox(0, "", "Char " & $i & ": " & Asc(StringMid($a, $i, 1)))
Next

How's that for odd?

<{POST_SNAPBACK}>

thanks for ansver, but it should work with strings much longer and also containing EOL. So if U paste that into the Input Box, after first EOL string will be truncated :ph34r:
Link to comment
Share on other sites

thanks for ansver, but it should work with strings much longer and also containing EOL. So if U paste that into the Input Box, after first EOL string will be truncated  :ph34r:

<{POST_SNAPBACK}>

End Of Line? The CR and LF characters work fine inside a message box. It's only null characters that will terminate a string early since AutoIt stores all data as a variant.

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to comment
Share on other sites

End Of Line?  The CR and LF characters work fine inside a message box.  It's only null characters that will terminate a string early since AutoIt stores all data as a variant.

<{POST_SNAPBACK}>

Hmm. Anyway, I want to work with Clipboard, because it speed up my work. Thats why is InputBox unefficient for me.

I try to work with ASCII code, but it didn't work too.

Link to comment
Share on other sites

I try to work with ASCII code, but it didn't work too.

<{POST_SNAPBACK}>

Could you be dealing with Unicode? That uses 2 bytes per character instead of one, so reading it as a line into an AutoIt string varialbe would likely produce very odd results. If so, you could try to save it as plaintext.

Minor edit

Edited by pekster

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to comment
Share on other sites

Could you be dealing with Unicode?  That uses 2 bytes per character instead of one, so reading it as a line into an AutoIt string varialbe would likely produce very odd results.  If so, you could try to save it as plaintext.

Minor edit

<{POST_SNAPBACK}>

But how? only I could change is input language:

Posted Image

Aplication is the same: Notepad.:

1. CUT text from Notepad

2. Runing AutoIT script(with defined HOTKEY)

3. PASTE text back to Notepad

How could I switch to Unicode?

Link to comment
Share on other sites

How could I switch to Unicode?

<{POST_SNAPBACK}>

No, if you start with unicode characters, and try to have AutoIt process them, you will get strange results. I don't think AutoIt is set up to handle unicode strings properly.

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to comment
Share on other sites

This is a very old problem :ph34r: I'm also have trouble with it, and this is not only Autoit related. Don't sure that real solution possible until Autoit will handle Unicode.

BTW Slovak is default keyboard language in your system? In some cases this can solve problem.

Link to comment
Share on other sites

This is a very old problem :ph34r: I'm also have trouble with it, and this is not only Autoit related. Don't sure that real solution possible until Autoit will handle Unicode.

BTW Slovak is default keyboard language in your system? In some cases this can solve problem.

<{POST_SNAPBACK}>

No, default language is English, I need Slovak language to work(create/edit) with DOCs.

First idea of creating this script, was to CLEAN HTML SOURCE from empty tags like: <b></b> , <p>&nbsp;</p>....every other CHARacter(including č ť ....) should be intact.

Edited by mariasx
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...