Search the Community
Showing results for tags 'udf-8'.
-
Text translated from Portuguese by google - please apologize for any errors Hello I would like to know where I am going wrong and how to fix this simple program. The problem is this, I'm in Brazil and use the portuguese language that contains accented characters. When I use the editor SciTE autoit (which is very good) I have no problems. However to develop more complex programs I like to use an old program called "Autoit Debugger" for lack of anything better. It works fine until I use accented characters like "ç", "ã", "é" etc. When you open any file generated by SciTE in "Debugger" coding becomes US-ASCII and all accented characters disappear on the display but the bytes exist, secretly, generating unpredictable errors during debugging. I've tried changing the SciTE coding for UDF-8 and even then the "Debugger" US-ASCII encoding When I save the same file through the Notepad "Debugger" encoding "Western European (Windows)" that although display the characters also problems. I know someone can say ... that the problem is with the "Debugger" and the developer who has to solve this but this is impossible (I've tried no return). With this imagined creating a little program to open any file and convert to UDF-8 using "FileOpen" mode 256 Global $Contato = @CRLF & _ ;quebra a linha para ficar em baixo "A automao da automao criado por:" & @CRLF & _ ;Nome da empresas (site) "www.roboautomato.com.br (em construo)" & @CRLF & _ ; Cel "Skype: junior.prof" & @TAB & _ ; Dados do meu skype "Fone: +55 (11) 9-9372-0074 TIM" & @CRLF & _ ; Cel "www.facebook.com/roboautomato" & @TAB & _ ; Cel "E-mail: junior.prof@yahoo.com.br" ; e-mail ;15/11/26 Musança da sequencia pois assim é mais logico Global $ArqGravacao, _ ;contem os dados do arq de grava��o $ArqAbertoGravacao, _ ;Buter do arqiovo Aberto ou Handle $ArqQuantGravacao, _ ;Total de Bytes do arquivo de Leituta $ArqPosGravacao, _ ;Posi��o atual do arquivo em Bytes $ArqLinhaGravacao ;Linha atual do arquivo de leitura Global $ArqLeitura, _ ;contem os dados do arq de leitura $ArqAbertoLeitura, _ ;Buter do arqiovo Aberto ou Handle $ArqQuantLeitura, _ ;Total de Bytes do arquivo de Leituta $ArqPosLeitura, _ ;Posi��o atual do arquivo em Bytes $ArqLinhaLeitura ;Linha atual do arquivo de leitura #endregion Variaveis de Arquivos e pastas #region --- Internal functions Au3Recorder Start --- ;1 Localizar arquivo $ArqLeitura = FileOpenDialog("Localiza o arquivo", @ScriptDir & "", "Autoit Files (*.au3)|Todos (*.*)", 1 + 4) If @error Then MsgBox(Default, _; flag "Cancelado o Programa ", _;"title" "O arquivo ( " & $ArqLeitura & " ) não existe ou não esta disponivel" & @CRLF & _ "Ação:Abertura do Arquivo nao UDF8" & @CRLF & _ "Quarquer duvida entrar em contato" & @CRLF & _ $Contato, _ ; "text" 5, _ ;[, timeout Default);[, hwnd]]) Exit EndIf $ArqAbertoLeitura = FileOpen($ArqLeitura, 16);leitura Binario ;define o nome de gravacao ; pegar a pasta melhorar Local $sDir_Name = StringRegExpReplace($ArqLeitura, "(^.*\\)(.*)", "\1") Local $NomeArq = StringRegExpReplace($ArqLeitura, "^.*\\", "") Local $NomeArqPos = StringInStr($NomeArq, ".", 0, -1);localiza o ponto da extensão Local $NomeArq2 = StringLeft($NomeArq, $NomeArqPos - 1) Local $NomeArqExt = StringRight($NomeArq, StringLen($NomeArq) - $NomeArqPos) $ArqGravacao = $sDir_Name & $NomeArq2 & "UDF8." & $NomeArqExt If FileExists($ArqGravacao) Then #region --- CodeWizard generated code Start --- ;MsgBox features: Title=Yes, Text=Yes, Buttons=Yes and No, Icon=Question If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(36, "Substituir o arquivo...", "O Arquivo [" & $ArqGravacao & "] ja existe deseja subistitui-lo (S/N)") Select Case $iMsgBoxAnswer = 7 ;No MsgBox(Default, _; flag "Cancelado o Programa ", _;"title" "O arquivo ( " & $ArqGravacao & " ) já existe" & @CRLF & _ "Ação:Já existe UDF8" & @CRLF & _ "Quarquer duvida entrar em contato" & @CRLF & _ $Contato, _ ; "text" 5, _ ;[, timeout Default);[, hwnd]]) Exit EndSelect FileDelete($ArqGravacao) #endregion --- CodeWizard generated code Start --- EndIf $ArqAbertoGravacao = FileOpen($ArqGravacao, 259);Gravação UDF8 sem BOM e sobreescrito 256+1+2 If $ArqAbertoGravacao = -1 Then ;Caso Verdade erro de abertura BlockInput(0); desbloqueia o usuario MsgBox(Default, _; flag "Cancelado o envio ", _;"title" "O arquivo ( " & $ArqGravacao & " ) não existe ou não esta disponivel" & @CRLF & _ "Ação:Gravando dados de fabrica" & @CRLF & _ "Quarquer duvida entrar em contato" & @CRLF & _ $Contato, _ ; "text" 5, _ ;[, timeout Default);[, hwnd]]) FileClose($ArqAbertoGravacao) ; FileDelete($ArqGravacao) Exit EndIf If $ArqAbertoLeitura = -1 Then ;Caso Verdade erro de abertura BlockInput(0); desbloqueia o usuario MsgBox(Default, _; flag "Cancelado o envio ", _;"title" "O arquivo ( " & $ArqLeitura & " ) não existe ou não esta disponivel" & @CRLF & _ "Ação: Abertura da Lista de Contatos" & @CRLF & _ "Quarquer duvida entrar em contato" & @CRLF & _ $Contato, _ ; "text" 5, _ ;[, timeout Default);[, hwnd]]) Exit Else $iLineNumber = 0 $Dimen = 0 $VarAtual = "" While True $iLineNumber += 1 $sCurrentLine = FileReadLine($ArqAbertoLeitura) ; , $iLineNumber) If @error = -1 Then ExitLoop ;acabou o arquivo então sai ;if $sCurrentLine<>"" Then ;obtem os dados da linha $sBinary = StringToBinary($sCurrentLine) ;MsgBox(Default, _; flag ;"Linha ["& $iLineNumber &"] ", _;"title" ;"[" & $sCurrentLine & "]" & @CRLF & _ ;"["& $sBinary &"]" & @CRLF & _ ;"["& BinaryToString( $sBinary,4) &"]", _ ;15, _ ;[, timeout ;Default);[, hwnd]]) $StringLine= BinaryToString( $sBinary,4) FileWriteLine($ArqAbertoGravacao,$StringLine) WEnd FileClose($ArqAbertoLeitura) FileClose($ArqAbertoGravacao) EndIf He did not change. The question is, how to generate a file UDF-8 plain text. PS miraculously have a UDF8 file to replicate can keep this encoding within the Debugger and paste the text I use without problems.