Homesource Forums

Homeworld Source Editing Talk
It is currently Mon Sep 25, 2017 10:53 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sun Nov 09, 2014 10:07 am 
Offline

Joined: Mon Jul 07, 2014 8:13 pm
Posts: 20
Seems that UIControls.c defines several arrays (uicKeyEntryTable, uicFrenchKeyEntryTable, uicGermanKeyEntryTable, etc) containing hard-coded constant chars in order to display in text input fields characters of different languages based on different keyboard layout. The non-ascii constant chars make my VC++ fail to compile because my Windows system locale is set to one of CJK locales. If I set the system locale to English, then this file can be compiled without errors. This problem of VC++ is also described at https://connect.microsoft.com/VisualStudio/feedback/details/341454/.

I think there're two solutions to choose to fix the problem to make the source code compilation not affected by system locale. The first is to change the encoding of all the source files to UTF-8. But I think that's ugly and not guaranteed to be cross-platform, especially VC++ often needs BOM to recognize UTF-8. So a better solution may be to apply some localization machanism (such as GNU gettext), and move all the non-ascii characters out of the source files and into config/data files.


Top
 Profile  
 
PostPosted: Sat Dec 06, 2014 1:38 pm 
Offline

Joined: Sat Mar 10, 2007 8:05 am
Posts: 3
Hello!

Em, could you please post build-log for errors?


Top
 Profile  
 
PostPosted: Sat Jan 24, 2015 11:00 pm 
Offline

Joined: Mon Jul 07, 2014 8:13 pm
Posts: 20
Here's the build-log of errors:

Code:
1>..\..\src\Game\UIControls.c(518) : warning C4305: 'initializing' : truncation from 'int' to 'char'
1>..\..\src\Game\UIControls.c(518) : error C2059: syntax error : 'constant'
1>..\..\src\Game\UIControls.c(518) : error C2001: newline in constant
1>..\..\src\Game\UIControls.c(519) : error C2059: syntax error : ','
1>..\..\src\Game\UIControls.c(520) : error C2001: newline in constant
1>..\..\src\Game\UIControls.c(525) : error C2001: newline in constant
1>..\..\src\Game\UIControls.c(527) : error C2001: newline in constant
1>..\..\src\Game\UIControls.c(637) : error C2001: newline in constant
1>..\..\src\Game\UIControls.c(648) : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>..\..\src\Game\UIControls.c(659) : error C2001: newline in constant
1>..\..\src\Game\UIControls.c(662) : error C2001: newline in constant
1>..\..\src\Game\UIControls.c(662) : error C2015: too many characters in constant
1>..\..\src\Game\UIControls.c(690) : error C2001: newline in constant
1>..\..\src\Game\UIControls.c(691) : error C2001: newline in constant
1>..\..\src\Game\UIControls.c(719) : error C2001: newline in constant
1>..\..\src\Game\UIControls.c(781) : error C2001: newline in constant
1>..\..\src\Game\UIControls.c(917) : error C2018: unknown character '0x60'
1>..\..\src\Game\UIControls.c(917) : error C2001: newline in constant
1>..\..\src\Game\UIControls.c(919) : error C2001: newline in constant
1>..\..\src\Game\UIControls.c(1041) : error C2001: newline in constant
1>..\..\src\Game\UIControls.c(1293) : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>..\..\src\Game\UIControls.c(1301) : error C2001: newline in constant
1>..\..\src\Game\UIControls.c(1437) : error C2001: newline in constant
1>..\..\src\Game\UIControls.c(5777) : fatal error C1004: unexpected end-of-file found


Line 518 is as follows in my VC++ editor (in Chinese locale):

Code:
    /* 0         48 48 */    { '? , '0' },


But I can see in vim (with the encoding being latin1) that it is actually:

Code:
    /* 0         48 48 */    { 'à' , '0' }


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group