Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 13th April 2005, 15:38   #1
Instructor
Major Dude
 
Join Date: Jul 2004
Posts: 665
Oem <-> Ansi

Somebody has a small console program or plugin for converting the text from oem in ansi?
Instructor is offline   Reply With Quote
Old 13th April 2005, 16:21   #2
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,220
I never did this, but MSDN declares:
The OemToChar function translates a string from the OEM-defined character set into either an ANSI or a wide-character string. (OEM stands for original equipment manufacturer.)

BOOL OemToChar(
LPCSTR lpszSrc, // pointer to string to translate
LPTSTR lpszDst // pointer to buffer for translated string
);

BOOL OemToCharBuff(
LPCSTR lpszSrc, // pointer to string to translate
LPTSTR lpszDst, // pointer to buffer for translated string
DWORD cchDstLength // size of buffer
);

lpszSrc
Pointer to a buffer containing one or more characters from the OEM-defined character set.
lpszDst
Pointer to the buffer for the translated string. If the OemToCharBuff function is being used as an ANSI function, the string can be translated in place by setting the lpszDst parameter to the same address as the lpszSrc parameter. This cannot be done if the OemToCharBuff function is being used as a wide-character function.
cchDstLength
Specifies the number of characters to translate in the buffer identified by the lpszSrc parameter.

Import Library: Use user32.lib.

And I see in the user32.dll
OemToCharA
OemToCharBuffA
OemToCharBuffW
OemToCharW
entry points.
Takhir is offline   Reply With Quote
Old 13th April 2005, 17:05   #3
Comperio
Major Dude
 
Comperio's Avatar
 
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
Not sure if this helps, but you might be able to use NSIS's built-in IntFmt command on a character-by-character basis. (It uses the wsprintf function at MSDN at http://msdn.microsoft.com/library/de...s/wsprintf.asp).

I'm just offering this as a possible solution--I've not actually tried it. At least in theory, it looks like it might work...
Comperio is offline   Reply With Quote
Old 13th April 2005, 18:38   #4
Instructor
Major Dude
 
Join Date: Jul 2004
Posts: 665
Thanks guys!
code:
StrCpy $0 `ãá᪨¥ ᨬ¢®«ë` ;OEM

; OEM2ANSI
System::Call 'user32::OemToChar(t r0, t .r1)'
; $1=`Ðóññêèå ñèìâîëû` ;ANSI

; ANSI2OEM
System::Call 'user32::CharToOem(t r1, t .r2)'
; $2=`ãá᪨¥ ᨬ¢®«ë` ;OEM

Instructor is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump