Jump to content

German umlauts in SciTE console


Exit
 Share

Recommended Posts

When using Win7 (German edition), the SciTE console output shows wrong chars for umlauts (ÄÖÜßäöü) with default codepage 850.
Changing to codepage 1252 , SciTE console output shows correct chars.
But running the BAT file in a CMD window it shows correct chars with default codepage 850 and garbage with codepage 1252.
 
Here the BAT file.

@echo off&cls&echo:&echo:Codepage Test&echo:
chcp
Help If | find "Verarbeitet"
chcp 1252
Help If | find "Verarbeitet"
echo:&echo:End of Codepage Test
if .%0. == .%1. pause&exit
start %0 %0

And here the screenshot.

post-45639-0-19342200-1420867390_thumb.j

How to define the correct codepage in SciTE properties?

 

App: Au3toCmd              UDF: _SingleScript()                             

Link to comment
Share on other sites

  • Developers

Could you post a example script that I can run on my English WIN7 version to play with?

Which version of SciTE are you using?

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

AutoIt3Wrapper v.14.801.2025.0 SciTE v.3.4.4.0   Keyboard:00000407  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64    Environment(Language:0407)
I think German umlauts are not available in English version. I'll be busy today. Will reconnect in the late evening.

Perhaps another German user can confirm this quirk. Just to exclude a config error in my system.

Thanks

Edited by Exit

App: Au3toCmd              UDF: _SingleScript()                             

Link to comment
Share on other sites

Hi,

schau mal hier

I had this problem too, my solution was to change the codepage first to 1252, then send all text outputs into a file via > (ie. dir c: > dateien.txt  and read then the outputs with fileread(). out from the textfile)

After that, change the codepage to 850.

The problem with this method is, that you can not make use of the Umlauts from Keyboard until the codepage is switched back!

Edited by AndyG
Link to comment
Share on other sites

You could try running the command window with unicode enabled using /U.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

You could try running the command window with unicode enabled using /U.

Since CMD is started by AutoIt3Wrapper SciTE4AutoIt, it should be handled there.

But I found a circumvention by adding the following lines to SciTEUser.properties.

# F5 and F7 for CMD and BAT files
command.go.*.cmd="chcp 1252>nul & $(FileNameExt)"
command.go.*.bat="chcp 1252>nul & $(FileNameExt)"
command.build.*.cmd=start "$(FileNameExt)" "$(FileNameExt)"
command.build.*.bat=start "$(FileNameExt)" "$(FileNameExt)"

The default system codepages are displayed with this code

$codepage1 = DllCall('kernel32.dll', 'int', 'GetLocaleInfoW', 'ulong', 0, 'dword', 11, 'wstr', '', 'int', 2048)[3]
$codepage2 = DllCall('kernel32.dll', 'int', 'GetLocaleInfoW', 'ulong', 0, 'dword', 4100, 'wstr', '', 'int', 2048)[3]
MsgBox(Default, Default, "Your system default codepages are " & $codepage1 &" and "& $codepage2, 0)
Edited by Exit

App: Au3toCmd              UDF: _SingleScript()                             

Link to comment
Share on other sites

Why are you running a batch file with AutoIt3Wrapper? Better yet, HOW are you running a batch file using AutoIt3Wrapper?

If you're running an AutoIt script that runs a batch file, then the wrapper never comes into it at all. If you're not using AutoIt to run the batch file, then the wrapper also never comes into it.

If you're running a batch file with AutoIt, you should convert the batch file to AutoIt and get rid of the batch file completely. Or I'm just not getting what you're doing and what the problem is. If this isn't AutoIt related and strictly a batch file issue, you should probably take it to another forum that deals with batch files.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Why are you running a batch file with AutoIt3Wrapper? Better yet, HOW are you running a batch file using AutoIt3Wrapper?

Sorry, it's not AutoIt3Wrapper, but SciTE4AutoIt.

The HOW follows later in this post.

 

If you're running an AutoIt script that runs a batch file, then the wrapper never comes into it at all. If you're not using AutoIt to run the batch file, then the wrapper also never comes into it.

I'm not running a *.AU3 script, but a *.BAT file.

But I use SciTE to run the BAT file by pressing F5 (go) or F7 (build).

F5 runs it in the SciTE output panel.

F7 starts it in a separate CMD window.

 

If you're running a batch file with AutoIt, you should convert the batch file to AutoIt and get rid of the batch file completely. Or I'm just not getting what you're doing and what the problem is.

SciTE4AutoIt is a perfect tool for developing CMD and BAT files. No AutoIt code involved.

I use BAT files to distribute code to installations, who don't like suspicious EXE files and are not willing to install AutoIt.

 

If this isn't AutoIt related and strictly a batch file issue, you should probably take it to another forum that deals with batch files.

Since it is a SciTE4AutoIt issue, I think this forum is fine.

 

 




And now  the HOW to.

 

Create and click the file "BAT4SciTE.bat" to enable menu entry in explorer window.

REG DELETE HKCR\batfile\shell\EditSciTE /f
REG DELETE HKCR\cmdfile\shell\EditSciTE /f
REG ADD    HKCR\batfile\shell\EditSciTE /f /d "Edit BAT file with SciTE4AutoIt"
REG ADD    HKCR\cmdfile\shell\EditSciTE /f /d "Edit CMD file with SciTE4AutoIt"
REG ADD    HKCR\batfile\shell\EditSciTE\command /f /t REG_EXPAND_SZ /d "%%ProgramFiles(x86)%%\AutoIt3\SciTE\SciTE.exe  ""%%1"""
REG ADD    HKCR\cmdfile\shell\EditSciTE\command /f /t REG_EXPAND_SZ /d "%%ProgramFiles(x86)%%\AutoIt3\SciTE\SciTE.exe  ""%%1"""
REG query  HKCR\batfile\shell\EditSciTE /s
REG query  HKCR\cmdfile\shell\EditSciTE /s

 

 

Append the following lines to SciTEUser.properties.

(SciTE menu --> Options --> Open User Options file)

# F5 and F7 for CMD and BAT files
command.go.*.cmd="$(FileNameExt)"
command.go.*.bat="$(FileNameExt)"
command.build.*.cmd=start "$(FileNameExt)" "$(FileNameExt)"
command.build.*.bat=start "$(FileNameExt)" "$(FileNameExt)"

Now you are ready to edit *.BAT files in SciTE.

Press F5 to run them in the output panel.

Press F7 to open a CMD window.

Here a sample to restart/switch WLAN     (WLAN_Restart.bat)

@echo off & SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
echo:&echo:Restart WLAN&echo:&echo:Select SSID to connect or "0" to cancel&echo:
set Choices=0
for /F "usebackq tokens=1,2* delims=:" %%i in (`netsh wlan show networks`) do (
    set /A LineCount=!LineCount!+1
    if "!LineCount!" == "2" (set Interface=%%j)
    set t=%%i
    if "!t:~0,4!" == "SSID" (set /A SSIDCount=!SSIDCount!+1
        set Choices=!Choices!!SSIDCount!
        set SSID!SSIDCount!=%%j
        echo %%i = %%j ))
echo:&Choice /C %Choices% /N  > NUL 2>&1
if .%Errorlevel%. == .1. (  echo: Wireless network NOT changed. & goto :end )
set /A index=%Errorlevel%-1
set SSID=!SSID%Index%:~1!
echo:SSID=%SSID% & echo:
netsh wlan connect  name="%SSID%" ssid="%SSID%" interface="%Interface:~1,-1%"
:end
echo:&echo:&pause&exit

Have fun :thumbsup:

 

App: Au3toCmd              UDF: _SingleScript()                             

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...