<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Localization strings in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Localization-strings/m-p/174319#M6166</link>
    <description>&lt;BLOCKQUOTE&gt;santi wrote:&lt;BR /&gt;I thought that problem would be the coding, but documentation gives me no other choise than present&lt;/BLOCKQUOTE&gt;
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.</description>
    <pubDate>Thu, 17 Feb 2011 10:07:19 GMT</pubDate>
    <dc:creator>Ralph Wessel</dc:creator>
    <dc:date>2011-02-17T10:07:19Z</dc:date>
    <item>
      <title>Localization strings</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Localization-strings/m-p/174316#M6163</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I can`t get over following problem:&lt;BR /&gt;&lt;BR /&gt;I have a GRC file with expressions to localize, but I cant make resource compiler to handle them. I tried to modify the compileGRCs.pl file, but its always the same: as soon as it finds a special character, it reports an error. I studied the documentation for several hours and there is described always only a way to sort the files themselves or make references to the strings, but never how to change the encoding.&lt;BR /&gt;&lt;BR /&gt;I found a function called CHGetUserCharCode / CHSetDefaultCharCode but either I`m using it wrong or its not working..&lt;BR /&gt;&lt;BR /&gt;So - where should the localized sentences be? I believe it`s the project_name.grc file under 'STR#' commands? I can now track them via ACAPI_Resource_GetLocStr (without the special characters of course)..&lt;BR /&gt;&lt;BR /&gt;I`m working on macbook with Xcode 3.2.4 and DevKit 14.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Santi&lt;/DIV&gt;</description>
      <pubDate>Thu, 03 Aug 2023 08:29:54 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Localization-strings/m-p/174316#M6163</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-03T08:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: Localization strings</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Localization-strings/m-p/174317#M6164</link>
      <description>&lt;BLOCKQUOTE&gt;santi wrote:&lt;BR /&gt;I have a GRC file with expressions to localize, but I cant make resource compiler to handle them.&lt;/BLOCKQUOTE&gt;
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?</description>
      <pubDate>Mon, 14 Feb 2011 22:13:29 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Localization-strings/m-p/174317#M6164</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2011-02-14T22:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: Localization strings</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Localization-strings/m-p/174318#M6165</link>
      <description>alright, so the compiler stops on &lt;BR /&gt;

&lt;PRE&gt;#include "Dim_Round.grc.ro"&lt;/PRE&gt; in the Dim_Round.r file&lt;BR /&gt;
&lt;BR /&gt;
and generates an output as:&lt;BR /&gt;

&lt;PRE&gt;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.                                                                  
 &lt;/PRE&gt;

the perl script is as I found it in examples:&lt;BR /&gt;

&lt;PRE&gt;#! /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";
&lt;/PRE&gt;

I thought that problem would be the coding, but documentation gives me no other choise than present
&lt;PRE&gt;-q utf8 0&lt;/PRE&gt;

Thanks a lot</description>
      <pubDate>Wed, 16 Feb 2011 22:10:06 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Localization-strings/m-p/174318#M6165</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-02-16T22:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: Localization strings</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Localization-strings/m-p/174319#M6166</link>
      <description>&lt;BLOCKQUOTE&gt;santi wrote:&lt;BR /&gt;I thought that problem would be the coding, but documentation gives me no other choise than present&lt;/BLOCKQUOTE&gt;
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.</description>
      <pubDate>Thu, 17 Feb 2011 10:07:19 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Localization-strings/m-p/174319#M6166</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2011-02-17T10:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: Localization strings</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Localization-strings/m-p/174320#M6167</link>
      <description>&lt;BLOCKQUOTE&gt;Ralph wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;santi wrote:&lt;BR /&gt;I thought that problem would be the coding, but documentation gives me no other choise than present&lt;/BLOCKQUOTE&gt;
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.&lt;/BLOCKQUOTE&gt;

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.&lt;BR /&gt;
&lt;BR /&gt;
Best, Akos</description>
      <pubDate>Thu, 17 Feb 2011 11:54:00 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Localization-strings/m-p/174320#M6167</guid>
      <dc:creator>Akos Somorjai</dc:creator>
      <dc:date>2011-02-17T11:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: Localization strings</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Localization-strings/m-p/174321#M6168</link>
      <description>Well, I tried
&lt;PRE&gt;-q utf8 utf8&lt;/PRE&gt;
and that worked, compiler succeeded and text is readable &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" /&gt; But I cant get any other coding in there, so maybe this would be the head question and answer: &lt;BR /&gt;
Where do I find the list of &amp;lt;script_code&amp;gt; encodings in a format for compiler? I mean in a GSCharCode format its a number from 0 to 100 or "CC_Name", but in the perl script its something else. I tried to search the documentation and found nothing..&lt;BR /&gt;
&lt;BR /&gt;
thanks a lot</description>
      <pubDate>Thu, 17 Feb 2011 18:24:16 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Localization-strings/m-p/174321#M6168</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-02-17T18:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: Localization strings</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Localization-strings/m-p/174322#M6169</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
we made a little progress in API development but we are stuck again on the encoding of GRC Compiler:&lt;BR /&gt;
&lt;BR /&gt;
grc file on a macintosh platform via the perl script in CompileGRCs.pl:&lt;BR /&gt;

&lt;PRE&gt;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) . "\"");
&lt;/PRE&gt;

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:
&lt;PRE&gt;-q utf8 1250
-q utf8 1252 
-q utf8 65001 
-q utf8 10029&lt;/PRE&gt;
and 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 
&lt;PRE&gt;-q utf8 1250&lt;/PRE&gt;

Thanks,&lt;BR /&gt;
&lt;BR /&gt;
Santi</description>
      <pubDate>Mon, 09 Jul 2012 17:13:23 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Localization-strings/m-p/174322#M6169</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-07-09T17:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: Localization strings</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Localization-strings/m-p/174323#M6170</link>
      <description>&lt;BLOCKQUOTE&gt;santi wrote:&lt;BR /&gt;Hi,&lt;BR /&gt;
&lt;BR /&gt;
we made a little progress in API development but we are stuck again on the encoding of GRC Compiler:&lt;BR /&gt;
&lt;BR /&gt;
grc file on a macintosh platform via the perl script in CompileGRCs.pl:&lt;BR /&gt;

&lt;PRE&gt;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) . """);
&lt;/PRE&gt;

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:
&lt;PRE&gt;-q utf8 1250
-q utf8 1252 
-q utf8 65001 
-q utf8 10029&lt;/PRE&gt;
and 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 
&lt;PRE&gt;-q utf8 1250&lt;/PRE&gt;

Thanks,&lt;BR /&gt;
&lt;BR /&gt;
Santi&lt;/BLOCKQUOTE&gt;

Hello Santi,&lt;BR /&gt;
&lt;BR /&gt;
This is a bit trickier than that.  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" /&gt; &lt;BR /&gt;
&lt;BR /&gt;
On Mac you'll have to use the appropriate CFStringEncoding for your region; for Czech it's 29 == kCFStringEncodingMacCentralEurRoman. You can find all the possible values in /System/Library/Frameworks/CoreFoundation.framework/Headers/CFStringEncodingExt.h).&lt;BR /&gt;
On Windows - as you have already discovered - you have to pass the code page.&lt;BR /&gt;
&lt;BR /&gt;
So the correct parameters for Czech would be &lt;B&gt;-q utf8 29&lt;/B&gt;.&lt;BR /&gt;
&lt;BR /&gt;
As part of the general direction towards a full Unicode ArchiCAD, we plan to make changes to this system in one of the next major releases.&lt;BR /&gt;
&lt;BR /&gt;
Best, Akos</description>
      <pubDate>Fri, 13 Jul 2012 08:37:59 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Localization-strings/m-p/174323#M6170</guid>
      <dc:creator>Akos Somorjai</dc:creator>
      <dc:date>2012-07-13T08:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: Localization strings</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Localization-strings/m-p/174324#M6171</link>
      <description>that works well, thanks a lot we would have never find out this one &lt;E&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/E&gt;&lt;BR /&gt;
&lt;BR /&gt;
Santi</description>
      <pubDate>Mon, 16 Jul 2012 10:07:22 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Localization-strings/m-p/174324#M6171</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-07-16T10:07:22Z</dc:date>
    </item>
  </channel>
</rss>

