PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

Problems editing zoom.zcfg.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problems editing zoom.zcfg.

    Hi:

    I am automating the process for running the Zoom Search tool (v5) so I am planning on running it from the command line using ZoomIndexer [auto-run option] <config-file>.

    I have the Zoom configuration file, zoom.zcfg, which contains my custom settings. I need to make just one change in this file (per release) before I run the tool. Basically, I need to update the value of the "LOGGING_FILE" variable to use the latest version number for my product.

    For example, I would update:

    #LOGGING_FILE:E:\ApplicationFiles\MSDZ\MSDL\702\docs\search_files\logs\searchwords.log

    to

    #LOGGING_FILE:E:\ApplicationFiles\MSDZ\MSDL\801\docs\search_files\logs\searchwords.log



    I am using a Perl script that is listed here http://wiki.hypexr.org/wikka.php?wakka=PerlFindReplace to perform my find and replace tasks. This script works fine for all other changes I make to TXT, HTML, etc. The problem is that when I use this script to update "zoom.zcfg", a lot of characters suddenly change to squares and/or chinese letters making the file unreadable and unusable. However, ... ...
    • If I manually edit "zoom.zcfg" using Notepad, then there is no issue at all.
    • If I copy the contents of "zoom.zcfg" and paste it into a new TXT file and rename it ""zoom.zcfg"", then when I run the Perl script above on the new "zoom.zcfg", then everything works fine. Note that (before running the Perl script) the size of the new "zoom.zcfg" is 2.7KB while the size of the original "zoom.zcfg" is 6KB!

    This troubleshooting leads me to believe that the issue is with some data in the original "zoom.zcfg" rather than with the Perl script. Would you know what's going on? Does it have anything to do with character encoding? I am working on a Windows XP machine.

    If you plan to run the Perl Script, make sure you remove the semi-colon shown in red below from line 11 or you wil get an error:
    open(FILE,$fileName); || die("Cannot Open File");

    Thanks,
    K
    Last edited by kutra; Jan-17-2011, 09:44 PM.

  • #2
    The problem is because the ZCFG file is in Unicode (UTF-16) and your script is not handling this.

    When you created your own .zcfg file by copying the contents, you created an ASCII file. This is why the file sizes are so different as well (UTF-16 is double-byte, so it should be about twice the size as the ASCII equivalent).

    While we unofficially handle ASCII .zcfg files (that is, Zoom will load it in), internally we use and expect an UTF-16 file (so we can handle multi-lingual category names, custom fields, folder names, etc.).

    Note that this is explained under section 2.2 of the "Zoom Configuration File Specification" document in the Zoom SDK.
    --Ray
    Wrensoft Web Software
    Sydney, Australia
    Zoom Search Engine

    Comment

    Working...
    X