Pages

Thursday 12 June 2014

UTF-8 Support w/ Java and Console

Using UTF-8 can still be difficult, as I experienced recently when I wrote an ASCII table in Java using UTF-8 box characters. The package is published now (skb-asciitable), and here is how I got UTF-8 support working.

 

 Javac

The java compiler might need a reminder to use UTF-8. The option -encoding UTF-8 should do the trick.

 

 Javadoc

Javadoc has 3 options for dealing with UTF-8 characters. encoding for the source (i.e. reading UTF-8 encoded java files), docencoding for the output (i.e. the html encoding) and charset for the output (i.e. to tell the browser what character set to use). All of these options need to be set to UTF-8. The ANT task for Javadoc has those options. So using encoding="UTF-8" docencoding="UTF-8" charset="UTF-8" should create UTF-8 html.

 

 Editor

Editing java files requires an editor that can handle UTF-8 and being configured to do so. Otherwise all UTF-8 characters will be scrambled. In Eclipse, one can set the respective file, the project or the complete workspace to use UTF-8 encoding. The default on Windows is CP1252, so make sure to change that before opening any UTF-8 file. Simply change the text file encoding on the resource. This will also change the output of the Eclipse console to UTF (in Juno and Keppler). Other editors will have their specific way to configure for UTF file handling.

Console

Console settings depend very much on the operating system and the terminal program used. In Windows (using cmd as shell), change the code page using this command: chcp 65001. In Cygwin, use a terminal that supports UTF-8, for instance the popular mintty. For both, the font Lucida Console supports almost all UTF-8 box drawing characters. Unix and Apple systems are usually better for UTF support.

JVM

Running a java program with UTF output might require to set the JVM to UTF as well. -Dfile.encoding=UTF-8 should do the trick.



Tuesday 5 April 2011

Back to the Future: Scenarios for Europe 2010 as seen in 1999

Two weeks ago I gave a talk during the MUCS workshop at PerCom looking into how we manage ubiquitous computing environments. I had built that talk some years back and find an occasion to present it roughly once a year. Interesting is that a lot of problems and issues we looked at five years ago are still that: problems and issues.

More interestingly, I used a document from the European Commission in my original talk and now, since I remembered that document, had a look into it again. It is a report published by the Forward Study group of the European Commission titled: Scenarios Europe 2010. You can download the working paper from CiteSeerx (link at the end of this entry). The report was published in 1999, which makes it even more interesting to look at it having seen the actual developments in the first decade of the new millennium by now.

The report identifies five different scenarios and provides a qualitative description of them, aiming to facilitate discussions within the Commission and Europe and to influence policy and decision making. The five scenarios are:

  • Triumphant Markets - in essence the ‘triumph of trade over war’, facilitated by technological advances and full employment in industrial countries but also an increased environmental damage;
  • The Hundred Flowers - grassroot activities taking over from old governments and multi-nationals with an increased focus on local development and probably a fragmentation of business and social life;
  • Shared Responsibilities - reconciliation of ideas such as solidarity and respect, underpinned by technological advances and a drastic reform of the public sector;
  • Creative Societies - after a phase of public spending cuts and new austerity programmes Europe again recognises the importance of the human dimension and the focus is on solving social problems, the tax system becomes ‘green’ and activities beyond the logic of market economy; and
  • Turbulent Neighbourhoods - the world is political unstable and troops are deployed to restore order, even within Europe, still without a coherent foreign and security policy.

After describing the scenarios, the report goes into details about what we know about the future (i.e. what we know in 1999), the key drivers for the scenarios and the used methodology.

From my point of view, the report is interesting because it does not try to predict how Europe will evolve, nor does it focus on a simple answer to how the future will look like. All scenarios cover a wide range of different aspects and many of them are not categorised as simply being 'good' or 'bad'. The problems the report suggests we'll have are here today: water, food, environment/ecology, education and digital divide, security (soft and hard), social and regional imbalances and inequalities.

I am not sure which, if any, of the five scenarios actually describes the world today. It's probably safe to say that the "triumph of the markets" didn't really happen. Technology certainly enabled a different way of us interacting with each other and opened new paths to engaging in social, political and economical issues. The obvious names coming to my mind are Twitter and Facebook being used when the volcanic ash cloud closed most of Europe's airspace (remember that?) or to coordinate protest actions in several countries earlier this year. I would argue that there is a stronger sense of shared responsibility and creativity here as well. Question then is, are we going towards turbulent neighbourhoods right now? Maybe not in Europe.

Well, if you have a spare minute you might have a look at the report itself. The scenario descriptions are not too long...

Reference:
Gilles Bertrand (Coord.), Anna Michalski, Lucio R. Pench: Scenarios Europe 2010 - Five possible Scenarios for Europe, Working Paper, Forward Studies Group, The European Commission, 1999, available at: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.125.4654&rep=rep1&type=pdf (last visited 04/04/2011)

Friday 1 April 2011

IETF RFCs published on April 1st, 2011

This year's fine collection:

  • RFC 5984 - Increasing Throughput in IP Networks with ESP-Based Forwarding: ESPBasedForwarding "This document proposes an experimental way of reaching infinite bandwidth in IP networks by the use of ESP-based forwarding. This document defines an Experimental Protocol for the Internet community."
  • RFC 6214 - Adaptation of RFC 1149 for IPv6 "This document specifies a method for transmission of IPv6 datagrams over the same medium as specified for IPv4 datagrams in RFC 1149. This document is not an Internet Standards Track specification; it is published for informational purposes."
  • RFC 6217 - Regional Broadcast Using an Atmospheric Link Layer "Broadcasting is a technology that has been largely discarded in favor of technologies like multicast. This document builds on RFC 919 and describes a more efficient routing mechanism for broadcast packets destined for multiple Local Area Networks (LANs) or Metropolitan Area Networks (MANs) using an alternative link layer. It significantly reduces congestion on network equipment and does not require additional physical infrastructure investment."
My favourite is 5984 ;)