Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Xpand] Encoding problem when linking or copying xpt tempates
[Xpand] Encoding problem when linking or copying xpt tempates [message #729327] Sun, 25 September 2011 22:31 Go to next message
Ali AKAR is currently offline Ali AKARFriend
Messages: 31
Registered: July 2009
Member
Hi,

When I link to the file in the file system an xpt template, I'm facing
an encoding problem. I'm running on Mac OS X 10.6.8 with the following
Kernel Version: Darwin 10.8.0 (I tried under Win32 and have the same issue)
I tried to change the encoding of the linked file but always the same
problem, any idea how to resolve this issue ??

The linked template:

�ENDREM�
�EXTENSION org::eclipse::xtend::util::stdlib::io�
�EXTENSION extensions::common�
�EXTENSION extensions::stack�
�EXTENSION os_utils::OsUtils�
�EXTENSION Os�
�EXTENSION Os_Variables�

�REM�
/*==============================================================================
** Version check between Os.xpt and Os.xml
**=============================================================================*/
�ENDREM�
�DEFINE versionCheck FOR Root::Os�
�LET "1" AS OS_CFILES_XPT_SCRIPT_FILE_MAJOR_VERSION�
�LET "0" AS OS_CFILES_XPT_SCRIPT_FILE_MINOR_VERSION�
�IF (OS_CFILES_XPT_SCRIPT_FILE_MAJOR_VERSION != Os_getSwMajorVersion())
|| (OS_CFILES_XPT_SCRIPT_FILE_MINOR_VERSION != Os_getSwMinorVersion())�
�ERROR "Error E01: Os.xpt and Os.xml files have not the same version"�
�ENDIF�

Thank you in advance,

Áli
Re: [Xpand] Encoding problem when linking or copying xpt tempates [message #729478 is a reply to message #729327] Mon, 26 September 2011 09:36 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

Hi Ali,

do you mean by linked file that the file does not exist in a project of your workspace? I usually set the file encoding of the Xpand project as project-specific setting.

Otherwise your workspace encoding must match the encoding of the Xpand template. You can set this in Window/Prefences/General/Workspace/Text File Encoding.

Kind regards,
~Karsten


Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: [Xpand] Encoding problem when linking or copying xpt tempates [message #729561 is a reply to message #729478] Mon, 26 September 2011 14:01 Go to previous messageGo to next message
Ali AKAR is currently offline Ali AKARFriend
Messages: 31
Registered: July 2009
Member
Hi Karsten,

Thank you for your answer.

Yes exactly, File -> New -> File
Then in the wizard click on advanced>> select link file on the file
system then click browse and select an xpt file.

I set the workspace preference to UTF-8 and the project specific setting
also via right click -> properties -> Text file encoding.
In the .settings folder of my project, in the
org.eclipse.core.resources.prefs, I have encoding/<project>=UTF-8
but I have always this issue :(

kind regards,

Ali AKAR

On 9/26/11 11:36 AM, Karsten Thoms wrote:
> Hi Ali,
>
> do you mean by linked file that the file does not exist in a project of
> your workspace? I usually set the file encoding of the Xpand project as
> project-specific setting.
>
> Otherwise your workspace encoding must match the encoding of the Xpand
> template. You can set this in Window/Prefences/General/Workspace/Text
> File Encoding.
>
> Kind regards,
> ~Karsten
Re: [Xpand] Encoding problem when linking or copying xpt tempates [message #729936 is a reply to message #729327] Tue, 27 September 2011 10:23 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

Why do you need to link to external files? Use a project in your workspace that contains the template.

~Karsten


Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: [Xpand] Encoding problem when linking or copying xpt tempates [message #756745 is a reply to message #729936] Mon, 14 November 2011 21:33 Go to previous messageGo to next message
Ali AKAR is currently offline Ali AKARFriend
Messages: 31
Registered: July 2009
Member
Dear Karsten,

The problem does not come from the linking of external files.
As xpt files contain specific characters they emerge the encoding issue
mentioned in my case, especially when sharing files between different
users.
To work properly, either by linking the file or by copying it, we should
detect the encoding of the file when created. So when a user A create a
file under windows, usually the default encoding is set to "Cp1252" then
if this file is sent to a different user B which work under MAC, the
default encoding is set to "Mac Roman". User B will be unable to read
the file correctly. To read it, he should set the file encoding to "Cp1252".

To resolved this encoding inconsistencies across platforms, I propose to
set the default encoding for xpt files on creation to UTF-8, or detect
it from the content like xml files.

Kind regards,

Ali AKAR

On 9/27/11 12:23 PM, Karsten Thoms wrote:
> Why do you need to link to external files? Use a project in your
> workspace that contains the template.
>
> ~Karsten
Re: [Xpand] Encoding problem when linking or copying xpt tempates [message #756779 is a reply to message #756745] Tue, 15 November 2011 04:43 Go to previous message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

No, the user has to choose the right encoding.

I usually set the encoding of the folder containing templates to UTF-8. This way all new files automatically inherit this encoding, since the folder (or project-specific) encoding is shared through a settings file.

Sorry, but I will take no action here.

Kind regards,
~Karsten


Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Previous Topic:[Acceleo]
Next Topic:Acceleo : Skip code generation
Goto Forum:
  


Current Time: Thu Mar 28 19:06:47 GMT 2024

Powered by FUDForum. Page generated in 0.02415 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top