2011-02-14
12:16 AM
- last edited on
2023-08-03
10:29 AM
by
Doreena Deng
2011-02-14 11:13 PM
santi wrote:Is the resource compiler crashing or failing to produce the required output? If so, can you post the perl script you are using to drive the compiler?
I have a GRC file with expressions to localize, but I cant make resource compiler to handle them.
2011-02-16 11:10 PM
#include "Dim_Round.grc.ro"in the Dim_Round.r file
Converting resource files:
Dim_RoundFix.grc
Dim_Round.grc
Cannot get length of string, the string was ok until:
(now the whole grc file until the special character is present, ends before it - it does not display the special character)
The unmappable charater is:
\u0161
Write_Error: GeneralError: Memory allocation error
done.
the perl script is as I found it in examples:#! /usr/bin/perl -w
use FindBin ;
use File::Spec::Functions;
use File::Copy;
use Cwd;
#-----------------------------------------------------------------------
# Executes one GRC conversion command
#-----------------------------------------------------------------------
sub DoGRC ($$$$$)
{
my ($tool, $sourceDir, $inputFile, $destinationDir, $outputFile) = @_ ;
system ("mkdir -p \"" . $destinationDir . "\"") ;
# print $tool . " -m r -u 1 -q utf8 0 -T M -i \"" . catfile ($sourceDir, $inputFile) . "\" -j .roo -p \"" . catfile ($sourceDir, "Images") . "\" -o \"" . catfile ($destinationDir, $outputFile) . "\"\n" ;
print "\t$inputFile\n";
system ($tool . " -m r -u 1 -q utf8 0 -T M -i \"" . catfile ($sourceDir, $inputFile) . "\" -j .roo -p \"" . catfile ($sourceDir, "Images") . "\" -o \"" . catfile ($destinationDir, $outputFile) . "\"");
}
#-----------------------------------------------------------------------
# Convert GRC
#-----------------------------------------------------------------------
print "Converting resource files:\n";
my $devKitPath = catfile ($FindBin::Bin, updir (), updir (), updir ());
my $makeResConvTool = "\"" . catfile (Cwd::realpath ($devKitPath), "Support", "Tools", "OSX", "ResConv") . "\"";
my $examplePath = Cwd::realpath (catfile ($FindBin::Bin, updir ()));
my $resTarget = catfile ($ENV{TARGET_BUILD_DIR}, $ENV{UNLOCALIZED_RESOURCES_FOLDER_PATH});
my $roFolder = catfile ($examplePath, "RO");
DoGRC ( $makeResConvTool, catfile ($examplePath, "RFIX"), "Dim_RoundFix.grc", $roFolder, "Dim_RoundFix.grc.ro" ) ;
DoGRC ( $makeResConvTool, catfile ($examplePath, "RINT"), "Dim_Round.grc", $roFolder, "Dim_Round.grc.ro" ) ;
opendir (DIR, $roFolder);
@files = readdir (DIR);
closedir (DIR);
foreach $file (@files) {
copy (catfile ($roFolder, $file), $resTarget) if ($file =~ /.*\.tif$/);
}
print "done.\n";
I thought that problem would be the coding, but documentation gives me no other choise than present
-q utf8 0Thanks a lot
2011-02-17 11:07 AM
santi wrote:I tested this and hit the same problem. It looks like a bug in the GRC compiler - I think we need some input from someone at GS here.
I thought that problem would be the coding, but documentation gives me no other choise than present
2011-02-17 12:54 PM
Ralph wrote:The '-q utf8 0' specifies that the source file's encoding is UTF8. Can you just input that character as a 'normal' character instead of specifying it as a unicode character? Also, the '0' means Mac Roman encoding (old script manager script code), if you use a different language you may have to specify another value here as well.santi wrote:I tested this and hit the same problem. It looks like a bug in the GRC compiler - I think we need some input from someone at GS here.
I thought that problem would be the coding, but documentation gives me no other choise than present
2011-02-17 07:24 PM
-q utf8 utf8and that worked, compiler succeeded and text is readable
2012-07-09 07:13 PM
system ($tool . " -m r -u 1 -q utf8 0 -T M -i \"" . catfile ($sourceDir, $inputFile) . "\" -j .roo -p \"" . catfile ($sourceDir, "Images") . "\" -o \"" . catfile ($destinationDir, $outputFile) . "\"");Now I need to add my counry/region encoding - for Czech Republic it is Eastern Europe on windows 1250 - that works well. But on Mac if I tried:
-q utf8 1250 -q utf8 1252 -q utf8 65001 -q utf8 10029and it just doesnt work.. am I doing something wrong? The file compiles but the characters are wrong. I am testing it on czech version of archicad - AC 15 CZE. Again, on Windows is a little bit different process but it works with
-q utf8 1250Thanks,
2012-07-13 10:37 AM
santi wrote:Hello Santi,
Hi,
we made a little progress in API development but we are stuck again on the encoding of GRC Compiler:
grc file on a macintosh platform via the perl script in CompileGRCs.pl:
system ($tool . " -m r -u 1 -q utf8 0 -T M -i "" . catfile ($sourceDir, $inputFile) . "" -j .roo -p "" . catfile ($sourceDir, "Images") . "" -o "" . catfile ($destinationDir, $outputFile) . """);Now I need to add my counry/region encoding - for Czech Republic it is Eastern Europe on windows 1250 - that works well. But on Mac if I tried:-q utf8 1250 -q utf8 1252 -q utf8 65001 -q utf8 10029and it just doesnt work.. am I doing something wrong? The file compiles but the characters are wrong. I am testing it on czech version of archicad - AC 15 CZE. Again, on Windows is a little bit different process but it works with-q utf8 1250Thanks,
Santi
2012-07-16 12:07 PM