1*9780544fSAndrew Rist#**************************************************************
2*9780544fSAndrew Rist#
3*9780544fSAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
4*9780544fSAndrew Rist#  or more contributor license agreements.  See the NOTICE file
5*9780544fSAndrew Rist#  distributed with this work for additional information
6*9780544fSAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
7*9780544fSAndrew Rist#  to you under the Apache License, Version 2.0 (the
8*9780544fSAndrew Rist#  "License"); you may not use this file except in compliance
9*9780544fSAndrew Rist#  with the License.  You may obtain a copy of the License at
10*9780544fSAndrew Rist#
11*9780544fSAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
12*9780544fSAndrew Rist#
13*9780544fSAndrew Rist#  Unless required by applicable law or agreed to in writing,
14*9780544fSAndrew Rist#  software distributed under the License is distributed on an
15*9780544fSAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*9780544fSAndrew Rist#  KIND, either express or implied.  See the License for the
17*9780544fSAndrew Rist#  specific language governing permissions and limitations
18*9780544fSAndrew Rist#  under the License.
19*9780544fSAndrew Rist#
20*9780544fSAndrew Rist#**************************************************************
21*9780544fSAndrew Rist
22*9780544fSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweirpackage installer::windows::language;
25cdf0e10cSrcweir
26cdf0e10cSrcweiruse installer::exiter;
27cdf0e10cSrcweir
28cdf0e10cSrcweir####################################################
29cdf0e10cSrcweir# Determining the Windows language (LCID)
30cdf0e10cSrcweir# English: 1033
31cdf0e10cSrcweir####################################################
32cdf0e10cSrcweir
33cdf0e10cSrcweirsub get_windows_language
34cdf0e10cSrcweir{
35cdf0e10cSrcweir	my ($language) = @_;
36cdf0e10cSrcweir
37cdf0e10cSrcweir	my $windowslanguage = "";
38cdf0e10cSrcweir
39cdf0e10cSrcweir	if ( $installer::globals::msilanguage->{$language} ) { $windowslanguage = $installer::globals::msilanguage->{$language}; }
40cdf0e10cSrcweir
41cdf0e10cSrcweir	if ( $windowslanguage eq "" ) { installer::exiter::exit_program("ERROR: Unknown language $language in function get_windows_language", "get_windows_language"); }
42cdf0e10cSrcweir
43cdf0e10cSrcweir	return $windowslanguage;
44cdf0e10cSrcweir}
45cdf0e10cSrcweir
46cdf0e10cSrcweir####################################################
47cdf0e10cSrcweir# Determining the Windows language ANSI-Codepage
48cdf0e10cSrcweir# English: 1252
49cdf0e10cSrcweir####################################################
50cdf0e10cSrcweir
51cdf0e10cSrcweirsub get_windows_encoding
52cdf0e10cSrcweir{
53cdf0e10cSrcweir	my ($language) = @_;
54cdf0e10cSrcweir
55cdf0e10cSrcweir	my $windowsencoding = "";
56cdf0e10cSrcweir
57cdf0e10cSrcweir	if ( $installer::globals::msiencoding->{$language} ) { $windowsencoding = $installer::globals::msiencoding->{$language}; }
58cdf0e10cSrcweir
59cdf0e10cSrcweir	# if ( $windowsencoding eq "" ) { installer::exiter::exit_program("ERROR: Unknown language $language in function get_windows_encoding", "get_windows_encoding"); }
60cdf0e10cSrcweir	if ( $windowsencoding eq "" ) { $windowsencoding = "0"; }	# setting value, if the language is not listed in the encodinglist
61cdf0e10cSrcweir
62cdf0e10cSrcweir	if ( $windowsencoding eq "0" ) { $windowsencoding = "65001"; }	# languages with "0" have to be available in UTF-8 (65001)
63cdf0e10cSrcweir
64cdf0e10cSrcweir	# Asian multilingual installation sets need a code neutral Windows Installer database -> $windowsencoding = 0
65cdf0e10cSrcweir	if (( $language eq "en-US" ) && (( $installer::globals::product =~ /suitemulti/i ) || ( $installer::globals::product =~ /officemulti/i ) || ( $installer::globals::product =~ /c05office/i ) || ( $installer::globals::added_english ))) { $windowsencoding = "0"; }
66cdf0e10cSrcweir
67cdf0e10cSrcweir	return $windowsencoding;
68cdf0e10cSrcweir}
69cdf0e10cSrcweir
70cdf0e10cSrcweir1;