Ignore:
Timestamp:
2019-12-11T18:28:29+13:00 (4 years ago)
Author:
ak19
Message:

Changes for getting a running GS3 server to display collections on Cher's Chinese locale machine. 1. A key change so far turned out to be the improvement Dr Bainbridge wanted in gs2build\setup.bat for this: which is controlling the codepage to be the English locale's Windows default of codepage 850 (but changed to 866 if GSDLLANG is Russian, so setup,bat's display strings in Russian print correctly. 2. Other changes were for XML parsing to parse utf8-file contents correctly on the Chinese locale, by seting JAVA_TOOL_OPTIONS env var to pass file.encoding=UTF-8 to the JVM (set in gs2build\setup.bat and exported in gs3-setup.bat), as well as for ant targets force-start-tomcat and force-stop-tomcat in build.xml to do the same. 3. Finally, uncomment Alias.pm import in perllib\plugins\DirectoryPlugin.pm and rename the new perllib\cpan\Encode's Alias.pm.newForLocaleIssue and updated Locale.pm.newForLocaleIssue to Alias.pm and Locale.pm respectively. Dr Bainbridge found that this was necessary for perl to work with the encoding on the Chinese locale, else running things like pluginfo.pl -describeAll on Windows would break on such locales.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/setup.bat

    r32986 r33793  
    66CD /D "%~dp0"
    77set GSDLLANG=en
     8
     9:: This script's contents were created in Windows codepage 850 (Western European).
     10:: When this script is run in non-English locales like the Chinese locale, the
     11:: character content/encoding of this script can get wrongly interpreted by the
     12:: different encoding of the locale. And then the GS environment gets set wrongly
     13:: or incompletely in those cases.
     14:: So we force this script to be run and interpreted in codepage 850.
     15:: However, the Russian display strings in this script were desgined to work in the
     16:: default Russian Windows codepage 866. Whereas, codepage 850 works for this
     17:: script's remaining English, French, Spanish display strings. So:
     18if ("!GSDLLANG!" == "ru") (
     19    chcp 866
     20) else (
     21    chcp 850
     22)
    823
    924echo.
     
    282297:: https://www.gnu.org/software/wget/manual/html_node/Wgetrc-Location.html
    283298set WGETRC=%GSDLHOME%/bin/%GSDLOS%/wgetrc
     299
     300
     301:: On other localse, like Chinese locales, for XMLParsers to read (XML) files
     302:: in UTF-8 encoding (instead of defaulting to encoding GBK when on Chinese locale),
     303:: need to pass -Dfile.encoding=UTF-8 to the JVM. Can have this passed to the JVM by
     304:: setting the JAVA_TOOL_OPTIONS environment variable to this here.
     305:: For example, the example at https://www.mkyong.com/java/how-to-read-utf-8-xml-file-in-java-sax-parser/
     306:: doesn't work in a Chinese locale until the program is run with
     307:: java -Dfile.encoding=UTF-8 <ReadXMLUTF8FileSAX>
     308::
     309::set JAVA_TOOL_OPTIONS=%JAVA_TOOL_OPTIONS% -Dfile.encoding=UTF-8
     310rem set JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8
Note: See TracChangeset for help on using the changeset viewer.