Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 29th August 2007, 11:18   #1
govmust
Junior Member
 
Join Date: Aug 2007
Posts: 11
Code page detection on taget computer

How can you detect which code page is used by target computer?

I'm making an installer that is using SerbianLatin language file, and it works fine if target computer has nonUnicode language set to Serbian. My problem is that most computers in my country are set to use English for nonUnicode and that makes my <č ć ž š đ> appear as <è æ ž š ð>.
Now I can live with <c c ž š dj> (corrections I made manually to language files) until NSIS goes Unicode, but to make that I need to detect codepage of target computer and use SerbianLatin <č ć ž š đ> or SerbianLatinModified <c c ž š dj>.
I'm guessing it goes into onInit function (before anything appears on screen) but don't know how to implement it.
govmust is offline   Reply With Quote
Old 29th August 2007, 17:55   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,337
Use GetACP.
code:
System::Call kernel32::GetACP()i.r0
${If} $0 == somecodepage
StrCpy $LANGUAGE ${LANG_SOMETHING}
${ElseIf} $0 == someothercodepage
StrCpy $LANGUAGE ${LANG_SOMETHINGELSE}
${Else}
StrCpy $LANGUAGE ${LANG_DEFAULT}
${EndIf}


NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 31st August 2007, 12:34   #3
govmust
Junior Member
 
Join Date: Aug 2007
Posts: 11
It works

Thanks kichik
govmust 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