Return-Path: X-Original-To: apmail-pivot-user-archive@www.apache.org Delivered-To: apmail-pivot-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C0B2569BE for ; Thu, 21 Jul 2011 16:14:57 +0000 (UTC) Received: (qmail 76452 invoked by uid 500); 21 Jul 2011 16:14:57 -0000 Delivered-To: apmail-pivot-user-archive@pivot.apache.org Received: (qmail 76395 invoked by uid 500); 21 Jul 2011 16:14:56 -0000 Mailing-List: contact user-help@pivot.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@pivot.apache.org Delivered-To: mailing list user@pivot.apache.org Received: (qmail 76387 invoked by uid 99); 21 Jul 2011 16:14:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jul 2011 16:14:56 +0000 X-ASF-Spam-Status: No, hits=4.0 required=5.0 tests=FREEMAIL_FROM,FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of donvodka@gmail.com designates 209.85.216.54 as permitted sender) Received: from [209.85.216.54] (HELO mail-qw0-f54.google.com) (209.85.216.54) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jul 2011 16:14:48 +0000 Received: by qwc9 with SMTP id 9so988531qwc.13 for ; Thu, 21 Jul 2011 09:14:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=JcVOyQbkCEEJgiFZV4ohKwtws5Dx6UiD3vY+vgFvnpc=; b=hBRDukUNVC7H7+jYHnPxnoxKEcFaBrYpYxO5Tre8rj/Jz0KTrEmxysbpQQvB8Pxmqw hIUzAzzzx6HduV7GInxPIe4JNmeEW93gGxghliq5i4JrIA1/Ba1qtb5Uzk7InsX6q2Ex mvT3lK+Kv3CXAP/M0rg5P7t+nl+Mcc1l5f8VU= Received: by 10.224.193.201 with SMTP id dv9mr393680qab.395.1311264867721; Thu, 21 Jul 2011 09:14:27 -0700 (PDT) Received: from [192.168.0.10] ([189.129.75.130]) by mx.google.com with ESMTPS id 1sm937767qcy.19.2011.07.21.09.14.25 (version=SSLv3 cipher=OTHER); Thu, 21 Jul 2011 09:14:26 -0700 (PDT) Message-ID: <4E285063.5060607@gmail.com> Date: Thu, 21 Jul 2011 11:14:27 -0500 From: Edgar Merino User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110601 Thunderbird/3.1.10 MIME-Version: 1.0 To: user@pivot.apache.org Subject: Re: Encodings and scripting languages References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------060509090307000605040902" This is a multi-part message in MIME format. --------------060509090307000605040902 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Ok I've been struggling with this for days and can't find a solution: suppose I have a python script that uses a utf-8 string, like this: myString = unicode("canci�n", "utf-8") if I run the script in linux it'll work without a problem, but if I run it under windows then "myString" will containt gargabe instead of "�", I have to manually open the script in windows and change it, this changes encoding when saving the file to iso-8859-1. I would like to stick with utf-8 for my scripts, but I don't know how to handle this type of characters in windows. One solution I've found is to use native2ascii in my scripts so my strings will be unicode. I have also tried setting the encoding declaration in the script itself but an exception is throws complaining that I cannot declare the encoding when the script is being evaluated (the whole script is a string). Is there a way to define an encoding for the script that'll be included in a bxml file? Any help is greatly appreaciated! Edgar Merino El 18/07/11 14:27, Edgar Merino escribi�: > Hello Sandro, I'll be glad to contribute to the project by porting the > Hello World! script example to jython, I'll just need some time until > I finish this project, but you can count on it! > > Greg, Sandro: I actually found it's an IDE issue, the files are being > copied using UTF-8 for it's encoding, I tried filtering the resources > using latin1 (iso-8859-1) but I had the same results, I'll see what I > can do and I'll let you know the results as soon as I get them. > > > Thanks for your help! > Edgar Merino > > 2011/7/16 Sandro Martini > > > Hi all, > Edgar can you attach here a zip containing a minimal sample to see > the issue ? > Thank you very much. > Ah, on apache-extras I've created some time ago an empty project, > pivot-jython ... are you interested in help us and fill there some > content (non copyrighted, like some minimal example) ? We already > have there other projects for other JVM languages ... > > Tell me. > > Bye, > Sandro > > Il giorno 16/lug/2011 01:30, "Edgar Merino" > ha scritto: > > > Hello, I've been working on a project using Apache Pivot and > Python for UI > > logic. Everything works perfectly, except for encodings. It > seems that pivot > > only registeres the default system encoding, excluding all > others. This is > > causing me problems since the application I'm writing is suppose > to run in > > windows (latin1) and my development machine uses linux (utf-8), > forcing me > > to manually change the encoding for strings when making > production releases. > > > > Has anyone got any information on this issue? I'm able to open a > jython > > console and use different encodings, but somehow this is not > working in > > pivot. Perhaps this is not a pivot issue, but an issue with the > javax.script > > API. > > > > > > I hope someone has an answer to this, thanks in advance. > > Edgar Merino > > --------------060509090307000605040902 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Ok I've been struggling with this for days and can't find a solution: suppose I have a python script that uses a utf-8 string, like this:

myString = unicode("canción", "utf-8")

if I run the script in linux it'll work without a problem, but if I run it under windows then "myString" will containt gargabe instead of "ó", I have to manually open the script in windows and change it, this changes encoding when saving the file to iso-8859-1.

I would like to stick with utf-8 for my scripts, but I don't know how to handle this type of characters in windows. One solution I've found is to use native2ascii in my scripts so my strings will be unicode.

I have also tried setting the encoding declaration in the script itself but an exception is throws complaining that I cannot declare the encoding when the script is being evaluated (the whole script is a string). Is there a way to define an encoding for the script that'll be included in a bxml file?


Any help is greatly appreaciated!
Edgar Merino

El 18/07/11 14:27, Edgar Merino escribió:
Hello Sandro, I'll be glad to contribute to the project by porting the Hello World! script example to jython, I'll just need some time until I finish this project, but you can count on it!

Greg, Sandro: I actually found it's an IDE issue, the files are being copied using UTF-8 for it's encoding, I tried filtering the resources using latin1 (iso-8859-1) but I had the same results, I'll see what I can do and I'll let you know the results as soon as I get them.


Thanks for your help!
Edgar Merino

2011/7/16 Sandro Martini <sandro.martini@gmail.com>

Hi all,
Edgar can you attach here a zip containing a minimal sample to see the issue ?
Thank you very much.
Ah, on apache-extras I've created some time ago an empty project, pivot-jython ... are you interested in help us and fill there some content (non copyrighted, like some minimal example) ? We already have there other projects for other JVM languages ...

Tell me.

Bye,
Sandro

Il giorno 16/lug/2011 01:30, "Edgar Merino" <donvodka@gmail.com> ha scritto:

> Hello, I've been working on a project using Apache Pivot and Python for UI
> logic. Everything works perfectly, except for encodings. It seems that pivot
> only registeres the default system encoding, excluding all others. This is
> causing me problems since the application I'm writing is suppose to run in
> windows (latin1) and my development machine uses linux (utf-8), forcing me
> to manually change the encoding for strings when making production releases.
>
> Has anyone got any information on this issue? I'm able to open a jython
> console and use different encodings, but somehow this is not working in
> pivot. Perhaps this is not a pivot issue, but an issue with the javax.script
> API.
>
>
> I hope someone has an answer to this, thanks in advance.
> Edgar Merino

--------------060509090307000605040902--