Return-Path: X-Original-To: apmail-maven-users-archive@www.apache.org Delivered-To: apmail-maven-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 331BF7F8A for ; Mon, 10 Oct 2011 23:02:58 +0000 (UTC) Received: (qmail 72346 invoked by uid 500); 10 Oct 2011 23:02:54 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 72257 invoked by uid 500); 10 Oct 2011 23:02:54 -0000 Mailing-List: contact users-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Users List" Reply-To: "Maven Users List" Delivered-To: mailing list users@maven.apache.org Received: (qmail 72249 invoked by uid 99); 10 Oct 2011 23:02:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Oct 2011 23:02:54 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of eric.kolotyluk@gmail.com designates 209.85.160.171 as permitted sender) Received: from [209.85.160.171] (HELO mail-gy0-f171.google.com) (209.85.160.171) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Oct 2011 23:02:47 +0000 Received: by gyh3 with SMTP id 3so10270482gyh.30 for ; Mon, 10 Oct 2011 16:02: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:content-transfer-encoding; bh=iFgUi+xCuvt5ugkG8txPk7DHRsqwHbubeH15I2xGing=; b=gy0IRYcw9s45sC7olUDhXqcYKi6+SSQ3dkb9eFKceZkj66G22Tczg0DTWhosZ9qF04 nU7KRnXpB1/iT5Z7DNoT62cxN7qnNyUjwUeVCDZXWEYR8jrpvNMFtj1Eca4w5YZJF97u pCnQh9SSqxUIPWa7rQFm3/nBfwhtwO4VsPtJE= Received: by 10.42.159.68 with SMTP id k4mr20965411icx.25.1318287746882; Mon, 10 Oct 2011 16:02:26 -0700 (PDT) Received: from [192.168.0.110] (S0106001517afb061.vc.shawcable.net. [24.83.21.19]) by mx.google.com with ESMTPS id bu33sm19083071ibb.11.2011.10.10.16.02.25 (version=SSLv3 cipher=OTHER); Mon, 10 Oct 2011 16:02:26 -0700 (PDT) Message-ID: <4E937983.6050005@gmail.com> Date: Mon, 10 Oct 2011 16:02:27 -0700 From: Eric Kolotyluk User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: users@maven.apache.org Subject: Re: UTF-8 Test Mystery References: <4E936BF9.4070604@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org On 2011-10-10 3:56 PM, Jörg Schaible wrote: > Eric Kolotyluk wrote: > >> I am having trouble understanding a mystery. >> >> I have code that checks my .properties file to make sure that it has not >> been corrupted after being edited by a non UTF-8 editor. In particular I >> have a property called lambda = λ and I check to see that it actually >> does resolve to the correct character. >> >> If I run my code from main (my manual unit test) it works. If I run my >> test from JUnit in Eclipse, it works. But when the same test runs under >> Maven it fails because lambda = ? >> >> When I look in the actual properties file that the test runs with, >> lambda = λ, but somehow when the code runs it gets lambda = ?. >> >> I thought this was maybe a surefire configuration problems so I am using >> >> >> >> >> org.apache.maven.plugins >> maven-surefire-plugin >> 2.9 >> >> junit:junit >> UTF-8 >> UTF-8 >> UTF-8 >> -Xms256m -Xmx512m -XX:MaxPermSize=128m -ea >> >> >> >> >> >> but this makes no difference. Does anyone have any idea why my JUnit >> test fails running under surefire, but not running under Eclipse? > .properties files are supposed to be ISO-8859-1: > http://download.oracle.com/javase/7/docs/api/java/util/Properties.html#load(java.io.InputStream) > > - Jörg Actually, that is not strictly true any more. They added Properties#load(Reader reader) in Java 6, so you could set up a UTF-8 reader for a stream. I have been using UTF-8 without problems until I ran my tests under surefire. Cheers, Eric > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org > For additional commands, e-mail: users-help@maven.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org For additional commands, e-mail: users-help@maven.apache.org