Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Unicode string literals in transformation
[ATL] Unicode string literals in transformation [message #757450] Fri, 18 November 2011 13:30 Go to next message
Nikolay Kasyanov is currently offline Nikolay KasyanovFriend
Messages: 30
Registered: September 2010
Location: Russia
Member
Does ATL support unicode string literals? I have one in my transformation (it used as a field in output model), but encoding are broken in output model.

Maybe there is an option to specify processing encoding?

I'm launching my transformation programmatically.

[Updated on: Fri, 18 November 2011 13:31]

Report message to a moderator

Re: [ATL] Unicode string literals in transformation [message #757871 is a reply to message #757450] Fri, 18 November 2011 16:25 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

ATL provides a slightly old implementation of OCL, for which Unicode was
supported without specifying how.

OCL 2.3 introduced Java-like backslash escapes (excluding octal), some
of which were supported by pragmatic parsers already. So you could try
\uhhhh or just straight Unicode characters in UTF-8. It may well work.
If not you could provide your own helper function to parse \u's.
Internally, I'm sure ATL just uses Java String so it should all work.

Regards

Ed Willink

On 18/11/2011 13:30, corrmage wrote:
> Is ATL support unicode string literals? I have one in my
> transformation (it used as a field in output model), but encoding are
> broken in output model.
>
> Maybe there is an option to specify processing encoding?
>
> I'm launching my transformation programmatically.
Re: [ATL] Unicode string literals in transformation [message #758116 is a reply to message #757871] Mon, 21 November 2011 22:22 Go to previous message
Nikolay Kasyanov is currently offline Nikolay KasyanovFriend
Messages: 30
Registered: September 2010
Location: Russia
Member
Hi!
Thank you for reply, it made me investigate more.

I found that problem is in ATL -> ASM compilation. Unicode literal written in asm file as is, but encoding in xml header is ISO-8859-1, so, when asm loaded by VM, literal is broken.
I tried to edit asm by hand & added my literal in escaped form, i.e. something like:
<constant value="&#x410;&#x442;&#x440;&#x438;&#x431;&#x443;&#x442;&#x44b;"/>

and now output model is ok, no problems with encoding.

What is the best solution for this? Maybe I should file a bug? It's not very handy to edit asm file before every deploy.

Also when I tried to add literal in atl file in \uXXXX notation, ATL builder encountered null pointer exception.

[Updated on: Mon, 21 November 2011 22:24]

Report message to a moderator

Previous Topic:Incorrect output HOT
Next Topic:[ATL] problem with a query on EMF-specific VM
Goto Forum:
  


Current Time: Thu Apr 25 14:45:48 GMT 2024

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

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

Back to the top