From ce18ccc1f3ce2239e8cf1ac02eafd9497d56b44e Mon Sep 17 00:00:00 2001 From: mösi Date: Fri, 7 Nov 2008 10:27:11 +0000 Subject: • EncodeUni kann jetzt auch Zeichen von U+0001 bis U+000D richtig umwandeln • Iterative Herangehensweise an das Ersetzen der mit Backslach escape-ten Zeichen, speziell \n wird jetzt korrekt ersetzt. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.neo-layout.org@1130 b9310e46-f624-0410-8ea1-cfbb3a30dc96 --- windows/neo-vars/src/Source/makecompose.ahk | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'windows/neo-vars/src/Source') diff --git a/windows/neo-vars/src/Source/makecompose.ahk b/windows/neo-vars/src/Source/makecompose.ahk index c7b7242..b3e6f18 100644 --- a/windows/neo-vars/src/Source/makecompose.ahk +++ b/windows/neo-vars/src/Source/makecompose.ahk @@ -1788,7 +1788,7 @@ SetFormat, Integer, hex char := SubStr(str,1,1) str := SubStr(str,2) if (asc(char) < 0x80) - result := result . "U00" . SubStr(asc(char),3) + result := result . "U" . SubStr("0000" . SubStr(asc(char),3),-3) else if (asc(char) < 0xC0) { ; error } else if (asc(char) < 0xE0) { @@ -1841,7 +1841,21 @@ Loop, parse, FileContents, `n, `r ; Specifying `n prior to `r allows both Windo Line := RegExReplace(Line,"[\t ]*(<[^>]*>)[\t ]*","$1") RegExMatch(Line,"([^:]*):[\t ]*""((\\.|[^""])*)"".*",OutputVar) ReplaceLeft := OutputVar1 - ReplaceRight := RegExReplace(OutputVar2,"\\(.)","$1") + ReplaceRight := "" + loop { + thechar := SubStr(OutputVar2,1,1) + OutputVar2 := SubStr(OutputVar2,2) + if (thechar == "\") { + thechar := SubStr(OutputVar2,1,1) + OutputVar2 := SubStr(OutputVar2,2) + if (thechar == "n") + thechar := chr(0x000d) ; Line-Feed + ReplaceRight := ReplaceRight . thechar + } else + ReplaceRight := ReplaceRight . thechar + if (OutputVar2 == "") + break + } ; care for replaceleft modkeys := "" @@ -1882,7 +1896,7 @@ FileDelete,%FTo% FileAppend,%Composita%,%FTo% } -EncodeUnicodeFile("..\..\..\Compose\en_US.UTF-8","Source\en_us.ahk" ,5609) +; EncodeUnicodeFile("..\..\..\Compose\en_US.UTF-8","Source\en_us.ahk" ,5609) EncodeUnicodeFile("..\..\..\Compose\Compose.neo","Source\neocomp.ahk" ,1067) ; MsgBox % EncodeUni(DecodeUni("U20ACU0041U0070")) -- cgit v1.2.3