<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>If Then Else Continue- Dicas de programação</title>
	<atom:link href="http://ifthenelsecontinue.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ifthenelsecontinue.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Sun, 01 May 2011 16:37:47 +0000</lastBuildDate>
	<language>pt</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='ifthenelsecontinue.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>If Then Else Continue- Dicas de programação</title>
		<link>http://ifthenelsecontinue.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://ifthenelsecontinue.wordpress.com/osd.xml" title="If Then Else Continue- Dicas de programação" />
	<atom:link rel='hub' href='http://ifthenelsecontinue.wordpress.com/?pushpress=hub'/>
		<item>
		<title>ANT: target privadas</title>
		<link>http://ifthenelsecontinue.wordpress.com/2011/05/01/ant-target-privadas/</link>
		<comments>http://ifthenelsecontinue.wordpress.com/2011/05/01/ant-target-privadas/#comments</comments>
		<pubDate>Sun, 01 May 2011 16:32:28 +0000</pubDate>
		<dc:creator>lmen32</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://ifthenelsecontinue.wordpress.com/?p=27</guid>
		<description><![CDATA[Um ficheiro de build é normalmente constituído por diversas targets. Destas, apenas algumas tem interesse de ser executadas directamente pelos utilizadores dos ficheiros de build. A maioria são targets que são chamadas por outras através de dependências. Seria interessante por isso identificar as targets que podia ser executadas pelo utilizador (targets públicas) e as targets [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ifthenelsecontinue.wordpress.com&amp;blog=1401746&amp;post=27&amp;subd=ifthenelsecontinue&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Um ficheiro de build é normalmente constituído por diversas targets. Destas, apenas algumas tem interesse de ser executadas directamente pelos utilizadores dos ficheiros de build. A maioria são targets que são chamadas por outras através de dependências. Seria interessante por isso identificar as targets que podia ser executadas pelo utilizador (targets públicas) e as targets que não deviam ser executas pelo utilizador (targets privadas). Como não existe nenhum atributo no ANT 1.7 para denotar este conceito estive à procura na internet de algumas alternativas. Cheguei às seguintes conclusões:</p>
<p>1. Não existe o conceito de private targets no ANT!<br />
2. No entanto existem alguns truques para evitar a :<br />
a) Se o nome do target começar com um menos (carácter -) o ant não a consegue executar, exemplo: &lt;target name=&#8221;-priva&#8221;&gt;<br />
b) Se um target não tiver a propriedade description=&#8221;" então ela <strong>não</strong> aparece na listagem de targets dadas pelo próprio ANT (parâmetro -projecthelp), mas continua a ser possível a execução da target. Para evitar a execução deve usar o truque 2.a).<br />
c) As views do eclipse &#8220;ANT&#8221; e de &#8220;Outline&#8221; por omissão não respeitam a regra 2.b). Em ambas as views há a opção &#8220;Hide Internal Targets&#8221; (através de um icon presente na própria view) que esconde<br />
as targets que não têm a propriedade description=&#8221;", excepto a target default do ficheiro ANT, se ela existir.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ifthenelsecontinue.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ifthenelsecontinue.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ifthenelsecontinue.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ifthenelsecontinue.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ifthenelsecontinue.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ifthenelsecontinue.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ifthenelsecontinue.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ifthenelsecontinue.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ifthenelsecontinue.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ifthenelsecontinue.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ifthenelsecontinue.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ifthenelsecontinue.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ifthenelsecontinue.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ifthenelsecontinue.wordpress.com/27/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ifthenelsecontinue.wordpress.com&amp;blog=1401746&amp;post=27&amp;subd=ifthenelsecontinue&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ifthenelsecontinue.wordpress.com/2011/05/01/ant-target-privadas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/79a16a851b2db78ef2fd415a38396d00?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lmen32</media:title>
		</media:content>
	</item>
		<item>
		<title>Ubuntu ler discos DVD encriptados</title>
		<link>http://ifthenelsecontinue.wordpress.com/2011/05/01/ubuntu-ler-discos-dvd-encriptados/</link>
		<comments>http://ifthenelsecontinue.wordpress.com/2011/05/01/ubuntu-ler-discos-dvd-encriptados/#comments</comments>
		<pubDate>Sun, 01 May 2011 16:19:35 +0000</pubDate>
		<dc:creator>lmen32</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://ifthenelsecontinue.wordpress.com/?p=25</guid>
		<description><![CDATA[Embora os leitores que acompanham o UBUNTU como o MPlayer ou o VLC conseguem ler DVDs exitem alguns DVDs que devido a questões de direito de autor tentam controlar, através de encriptação, quais os leitores que podem ler o filme. A instalação por omissão do Ubuntu não consegue ler os ficheiros guardados nos DVDs encriptados. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ifthenelsecontinue.wordpress.com&amp;blog=1401746&amp;post=25&amp;subd=ifthenelsecontinue&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Embora os leitores que acompanham o UBUNTU como o MPlayer ou o VLC conseguem ler DVDs exitem alguns DVDs que devido a questões de direito de autor tentam controlar, através de encriptação, quais os leitores que podem ler o filme. A instalação por omissão do Ubuntu não consegue ler os ficheiros guardados nos DVDs encriptados.</p>
<p>Para ultrapassar este problema de leitura é necessário instalar a biblioteca chamada <strong>libdvdcss2</strong>. As instruções de instalação da biblioteca estão definidas  na página <a title="RestrictedFormatsPlayingDVDs " href="https://help.ubuntu.com/community/RestrictedFormats/PlayingDVDs" target="_blank">https://help.ubuntu.com/community/RestrictedFormats/PlayingDVDs</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ifthenelsecontinue.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ifthenelsecontinue.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ifthenelsecontinue.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ifthenelsecontinue.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ifthenelsecontinue.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ifthenelsecontinue.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ifthenelsecontinue.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ifthenelsecontinue.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ifthenelsecontinue.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ifthenelsecontinue.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ifthenelsecontinue.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ifthenelsecontinue.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ifthenelsecontinue.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ifthenelsecontinue.wordpress.com/25/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ifthenelsecontinue.wordpress.com&amp;blog=1401746&amp;post=25&amp;subd=ifthenelsecontinue&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ifthenelsecontinue.wordpress.com/2011/05/01/ubuntu-ler-discos-dvd-encriptados/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/79a16a851b2db78ef2fd415a38396d00?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lmen32</media:title>
		</media:content>
	</item>
		<item>
		<title>Como alterar o tamanho de uma coluna CHAR que é chave estrangeira</title>
		<link>http://ifthenelsecontinue.wordpress.com/2011/02/20/como-alterar-o-tamanho-de-uma-coluna-char-que-e-chave-estrangeira/</link>
		<comments>http://ifthenelsecontinue.wordpress.com/2011/02/20/como-alterar-o-tamanho-de-uma-coluna-char-que-e-chave-estrangeira/#comments</comments>
		<pubDate>Sun, 20 Feb 2011 19:47:43 +0000</pubDate>
		<dc:creator>lmen32</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://ifthenelsecontinue.wordpress.com/?p=20</guid>
		<description><![CDATA[Quando uma coluna do tipo CHAR cujo valor é referenciado noutras tabelas como chave estrangeira necessita de um aumento no seu tamanho podemos deparar-nos com um obstáculo, porque existirão constraints na base de dados que serão quebradas com o aumento do tamanho máximo da coluna CHAR. Uma coluna do tipo CHAR é fisicamente armazenada com [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ifthenelsecontinue.wordpress.com&amp;blog=1401746&amp;post=20&amp;subd=ifthenelsecontinue&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Quando uma coluna do tipo CHAR cujo valor é referenciado noutras tabelas como chave estrangeira necessita de um aumento no seu tamanho podemos deparar-nos com um obstáculo, porque existirão constraints na base de dados que serão quebradas com o aumento do tamanho máximo da coluna CHAR.</p>
<p>Uma coluna do tipo CHAR é fisicamente armazenada com o mesmo tamanho independentemente do número de caracteres que guarda, assim, ao alterar o tamanho de uma coluna CHAR de 5 para 15 está-se a alterar o próprio valor da coluna e não a expandir o tamanho máximo que pode ser guardado na coluna (este comportamento é dado pelo tipo VARCHAR2).  Com o aumento do valor da coluna todas as outras colunas que referenciam a coluna alterada necessitam também dever o seu tamanho alterado, mas o seu tamanho não pode ser modificado porque as constraints das chaves estrangeiras da base de dados não deixam. Portanto o que tem de ser feito é desligar as constraints antes de alterar o tamanho da coluna, para depois voltarem a ser activadas.</p>
<pre>drop table kaka;
drop table kaka_ind;
drop table koko; 

<strong>-- criar as tabelas de testes e as suas relações</strong>
create table koko (

 col_a char(5),
 col_b numeric,

 primary key (col_a)

);

-- criar a tabela dois
create table kaka (

 col_a_a char(5),
 col_b_b numeric,

 col_fk char(5),

 primary key (col_a_a),
 constraint ghg_ds foreign key (col_fk) references koko(col_a)

);

create table kaka_ind (

 col_a_a char(5),
 col_b_b numeric,

 col_fk char(5),

 primary key (col_a_a),
 constraint kaka_ind_ghg_ds foreign key (col_fk) references koko(col_a)

);

create index kak_i on kaka_ind(col_fk);

<strong>-- inserir o texto ok</strong>
insert into koko (col_a, col_b) values ('00001', 1);
insert into  koko (col_a, col_b) values ('00002', 1);
insert into  koko (col_a, col_b) values ('00003', 1);
insert into  koko (col_a, col_b) values ('00004', 1);
insert into  koko (col_a, col_b) values ('00005', 1);
insert into  koko (col_a, col_b) values ('00006', 1);
insert into  koko (col_a, col_b) values ('00007', 1);
insert into  koko (col_a, col_b) values ('7', 1);

insert into  kaka (col_a_a, col_b_b, col_fk) values ('10001', 1, '00001');
insert into  kaka (col_a_a, col_b_b, col_fk) values ('10002', 1, '00002');
insert into  kaka (col_a_a, col_b_b, col_fk) values ('10003', 1, '00003');
insert into  kaka (col_a_a, col_b_b, col_fk) values ('10004', 1, '00004');
insert into  kaka (col_a_a, col_b_b, col_fk) values ('10005', 1, '00004');
insert into  kaka (col_a_a, col_b_b, col_fk) values ('10006', 1, '00005');
insert into  kaka (col_a_a, col_b_b, col_fk) values ('10007', 1, '7');

insert into  kaka_ind (col_a_a, col_b_b, col_fk) values ('10001', 1, '00001');
insert into  kaka_ind (col_a_a, col_b_b, col_fk) values ('10002', 1, '00002');
insert into  kaka_ind (col_a_a, col_b_b, col_fk) values ('10003', 1, '00003');
insert into  kaka_ind (col_a_a, col_b_b, col_fk) values ('10004', 1, '00004');
insert into  kaka_ind (col_a_a, col_b_b, col_fk) values ('10005', 1, '00004');
insert into  kaka_ind (col_a_a, col_b_b, col_fk) values ('10006', 1, '00005');
insert into  kaka_ind (col_a_a, col_b_b, col_fk) values ('10007', 1, '7');

select col_a, length(col_a), col_b, length(col_b) from koko;
select col_a_a, length(col_a_a), col_b_b, length(col_b_b), col_fk, length(col_fk) from kaka;
select col_a_a, length(col_a_a), col_b_b, length(col_b_b), col_fk, length(col_fk) from kaka_ind;

<strong>-- deve dar erro: por causa dos valores nas chaves estrangeiras</strong>
alter table koko  modify col_a char(15);

select * from ALL_CONSTRAINTS where TABLE_NAME = 'KAKA'

select * from ALL_CONS_COLUMNS where TABLE_NAME = 'KAKA'

<strong>-- determinar as constraints das chaves estrangeiras de uma chave privada </strong>
select * from ALL_CONS_COLUMNS
where
(table_name, constraint_name) in (

select cons.table_name, cons.constraint_name
from ALL_CONSTRAINTS cons
where cons.constraint_type = 'R'
and r_constraint_name in
(select constraint_name from ALL_CONSTRAINTS where table_name = 'KOKO' and  constraint_type = 'P')
) order by position

<strong>-- desligar as constraints das chaves estrangeiras</strong>
ALTER TABLE kaka DISABLE CONSTRAINT ghg_ds KEEP INDEX;   

ALTER TABLE kaka_ind DISABLE CONSTRAINT KAKA_IND_GHG_DS KEEP INDEX;   

<strong>-- modificar o tamanho das colunas</strong>
alter table koko  modify col_a char(15);

alter table kaka modify col_fk char(15);

alter table kaka_ind modify col_fk char(15);

<strong>-- voltar a ligar as constraints. Primeiro no estado NOVALIDATE para  que as novas linhas sejam sujeitas às constraints mas, as antigas não</strong>

ALTER TABLE kaka ENABLE NOVALIDATE CONSTRAINT ghg_ds;

ALTER TABLE kaka_ind ENABLE NOVALIDATE CONSTRAINT KAKA_IND_GHG_DS;

<strong>-- ligar definitivamente as constraints para todas as linhas das tabelas</strong>
ALTER TABLE kaka ENABLE CONSTRAINT ghg_ds;

ALTER TABLE kaka_ind ENABLE CONSTRAINT KAKA_IND_GHG_DS;

<strong>-- Confirmar se as constraints estão efectivamente ligadas</strong>
select col_a, length(col_a), col_b, length(col_b) from koko;
select col_a_a, length(col_a_a), col_b_b, length(col_b_b), col_fk, length(col_fk) from kaka;
select col_a_a, length(col_a_a), col_b_b, length(col_b_b), col_fk, length(col_fk) from kaka_ind;

-- tem de dar erro, porqueo valor para a chave já existe
insert into  koko (col_a, col_b) values ('7', 1);
-- tem de dar erro: porque col_fk não já existe na tabela koko
insert into  kaka (col_a_a, col_b_b, col_fk) values ('10009', 1, '79');

insert into  kaka_ind (col_a_a, col_b_b, col_fk) values ('10009', 1, '79');

-- os inserts devem agora funcionar
insert into  koko (col_a, col_b) values ('8', 1);
insert into  kaka (col_a_a, col_b_b, col_fk) values ('10010', 1, '8');
insert into  kaka_ind (col_a_a, col_b_b, col_fk) values ('10010', 1, '<a title="Documentação da Oracle: alterar constraints" href="http://download.oracle.com/docs/cd/B28359_01/server.111/b28310/general005.htm#CHDFEJII">8');

Referência:

http://download.oracle.com/docs/cd/B28359_01/server.111/b28310/general005.htm#CHDFEJII</a>
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ifthenelsecontinue.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ifthenelsecontinue.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ifthenelsecontinue.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ifthenelsecontinue.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ifthenelsecontinue.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ifthenelsecontinue.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ifthenelsecontinue.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ifthenelsecontinue.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ifthenelsecontinue.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ifthenelsecontinue.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ifthenelsecontinue.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ifthenelsecontinue.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ifthenelsecontinue.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ifthenelsecontinue.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ifthenelsecontinue.wordpress.com&amp;blog=1401746&amp;post=20&amp;subd=ifthenelsecontinue&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ifthenelsecontinue.wordpress.com/2011/02/20/como-alterar-o-tamanho-de-uma-coluna-char-que-e-chave-estrangeira/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/79a16a851b2db78ef2fd415a38396d00?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lmen32</media:title>
		</media:content>
	</item>
		<item>
		<title>Apontamentos sobre a linguagem java versão 5.0</title>
		<link>http://ifthenelsecontinue.wordpress.com/2008/05/15/apontamentos-sobre-a-linguagem-java-versao-50/</link>
		<comments>http://ifthenelsecontinue.wordpress.com/2008/05/15/apontamentos-sobre-a-linguagem-java-versao-50/#comments</comments>
		<pubDate>Thu, 15 May 2008 15:10:34 +0000</pubDate>
		<dc:creator>lmen32</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://ifthenelsecontinue.wordpress.com/?p=16</guid>
		<description><![CDATA[Neste documento Apontamentos sobre a Linguagem Java 5.0 encontram-se notas sobre a linguagem Java 5.0 que foram tiradas durante a preparação para o exame SCJP da Sun. Espero que a sua divulgação possa ajudar alguém a melhor compreender a linguagem. Naturalmente que todas as correcções e sugestões de melhoramento são bem-vindas.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ifthenelsecontinue.wordpress.com&amp;blog=1401746&amp;post=16&amp;subd=ifthenelsecontinue&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Neste documento <a href="http://ifthenelsecontinue.files.wordpress.com/2008/05/certificacao.pdf">Apontamentos sobre a Linguagem Java 5.0</a> encontram-se notas sobre a linguagem Java 5.0 que foram tiradas durante a preparação para o exame SCJP da Sun.</p>
<p>Espero que a sua divulgação possa ajudar alguém a melhor compreender a linguagem.</p>
<p>Naturalmente que todas as correcções e sugestões de melhoramento são bem-vindas.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ifthenelsecontinue.wordpress.com/16/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ifthenelsecontinue.wordpress.com/16/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ifthenelsecontinue.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ifthenelsecontinue.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ifthenelsecontinue.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ifthenelsecontinue.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ifthenelsecontinue.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ifthenelsecontinue.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ifthenelsecontinue.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ifthenelsecontinue.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ifthenelsecontinue.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ifthenelsecontinue.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ifthenelsecontinue.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ifthenelsecontinue.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ifthenelsecontinue.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ifthenelsecontinue.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ifthenelsecontinue.wordpress.com&amp;blog=1401746&amp;post=16&amp;subd=ifthenelsecontinue&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ifthenelsecontinue.wordpress.com/2008/05/15/apontamentos-sobre-a-linguagem-java-versao-50/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/79a16a851b2db78ef2fd415a38396d00?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lmen32</media:title>
		</media:content>
	</item>
		<item>
		<title>funções em javascript</title>
		<link>http://ifthenelsecontinue.wordpress.com/2008/01/09/funcoes-em-javascript/</link>
		<comments>http://ifthenelsecontinue.wordpress.com/2008/01/09/funcoes-em-javascript/#comments</comments>
		<pubDate>Wed, 09 Jan 2008 23:46:21 +0000</pubDate>
		<dc:creator>lmen32</dc:creator>
				<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://ifthenelsecontinue.wordpress.com/2008/01/09/funcoes-em-javascript/</guid>
		<description><![CDATA[Cenário 1 se só existir esta função, function a() { alert("a()"); } ela pode ser chamada com qualquer número de parâmetros que o resultado é sempre: a(); a('iuy', 455, 54, 54); uma caixa de dialogo com a string a(), Não dando qualquer erro de invocação. Cenário 2 Agora se tivermos, só a seguinte função, function [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ifthenelsecontinue.wordpress.com&amp;blog=1401746&amp;post=11&amp;subd=ifthenelsecontinue&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><span style="text-decoration:underline;">Cenário 1 </span></strong></p>
<p>se só existir esta função,</p>
<pre>function a()   {       alert("a()");   }</pre>
<p>ela pode ser chamada com qualquer número de parâmetros que o resultado é sempre:</p>
<pre>  a();
  a('iuy', 455, 54, 54);</pre>
<p>uma caixa de dialogo com a string a(), <strong>Não dando qualquer erro de invocação.</strong></p>
<p><strong><span style="text-decoration:underline;">Cenário 2<br />
</span></strong></p>
<p>Agora se tivermos, só a seguinte função,</p>
<pre>function a(id)   {       alert("a(" + id + ")");   }</pre>
<p>Quando for chamado o código,<br />
a();<br />
a(&#8216;iuy&#8217;, 455, 54, 54);</p>
<p>mostra as seguintes caixas de dialogo:</p>
<ul>
<li> a(undefined)</li>
<li> a(iuy)</li>
</ul>
<p><strong>Não dando qualquer erro de invocação.</strong><br />
<strong><span style="text-decoration:underline;">Cenário 3</span></strong></p>
<p>Duas funções com o mesmo nome, mas com parâmetros diferentes</p>
<pre>function a(id)
  {
      alert("a(" + id + ")");
  }
  function a()
  {
      alert("a()");
  }</pre>
<p>Só a última é que fica disponível para invocação.</p>
<p><strong><span style="text-decoration:underline;">Conclusão: </span></strong><span style="text-decoration:underline;">qualquer função pode ser chamada com qualquer número de parâmetros que não será lançado nenhum erro. Os parâmetros da função não preenchidos no momento da invocação terão o valor &#8220;undefined&#8221;.</span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ifthenelsecontinue.wordpress.com/11/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ifthenelsecontinue.wordpress.com/11/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ifthenelsecontinue.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ifthenelsecontinue.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ifthenelsecontinue.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ifthenelsecontinue.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ifthenelsecontinue.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ifthenelsecontinue.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ifthenelsecontinue.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ifthenelsecontinue.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ifthenelsecontinue.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ifthenelsecontinue.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ifthenelsecontinue.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ifthenelsecontinue.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ifthenelsecontinue.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ifthenelsecontinue.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ifthenelsecontinue.wordpress.com&amp;blog=1401746&amp;post=11&amp;subd=ifthenelsecontinue&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ifthenelsecontinue.wordpress.com/2008/01/09/funcoes-em-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/79a16a851b2db78ef2fd415a38396d00?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lmen32</media:title>
		</media:content>
	</item>
		<item>
		<title>JavaScript</title>
		<link>http://ifthenelsecontinue.wordpress.com/2008/01/09/javascript/</link>
		<comments>http://ifthenelsecontinue.wordpress.com/2008/01/09/javascript/#comments</comments>
		<pubDate>Wed, 09 Jan 2008 23:33:58 +0000</pubDate>
		<dc:creator>lmen32</dc:creator>
				<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://ifthenelsecontinue.wordpress.com/2008/01/09/javascript/</guid>
		<description><![CDATA[Como criar uma classe em javascript: Definir a classe InputText /* definição dos tipos */ function InputText(id) // constructor da classe { this.id = id; // campos da classe this.text = &#8216;jkjh&#8217;; // campos da classe } // definição das operações através da propriedade prototype de cada classe InputText.prototype.setTextInInput = function () { var i [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ifthenelsecontinue.wordpress.com&amp;blog=1401746&amp;post=10&amp;subd=ifthenelsecontinue&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Como criar uma classe em javascript:</p>
<p>Definir a classe InputText</p>
<p>/* definição dos tipos */<br />
function InputText(id)  <strong>// constructor da classe</strong><br />
{<br />
<strong>this.id = id;   // campos da classe<br />
this.text = &#8216;jkjh&#8217;; // campos da classe</strong><br />
}<br />
// definição das operações através da propriedade prototype de cada classe</p>
<p><strong>InputText.prototype</strong>.setTextInInput = function () {<br />
var i = document.getElementById(<strong>this.</strong>id);  // o this indica a instância do objecto que está a invocar a operação</p>
<p>if (i)<br />
{<br />
i.value = this.text;<br />
}<br />
}</p>
<p>InputText.prototype.getTextInInput = function () {<br />
var i = document.getElementById(this.id);<br />
if (i)<br />
{<br />
return i.value;<br />
}<br />
}</p>
<p>InputText.prototype.getText = function () {<br />
this.text = this.getTextInInput();<br />
return this.text;<br />
}</p>
<p>InputText.prototype.setText = function (text) {</p>
<p>this.text = text;<br />
alert(&#8216;a:&#8217; + text);<br />
this.setTextInInput();<br />
}</p>
<p>InputText.prototype.clear = function () {<br />
this.text = &#8221;;<br />
this.setTextInInput();<br />
}</p>
<p><strong>Como usar: </strong></p>
<p>var itext = new InputText(&#8216;itext&#8217;);</p>
<p>itext.setText(&#8216;SLB&#8217;);</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ifthenelsecontinue.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ifthenelsecontinue.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ifthenelsecontinue.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ifthenelsecontinue.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ifthenelsecontinue.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ifthenelsecontinue.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ifthenelsecontinue.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ifthenelsecontinue.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ifthenelsecontinue.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ifthenelsecontinue.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ifthenelsecontinue.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ifthenelsecontinue.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ifthenelsecontinue.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ifthenelsecontinue.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ifthenelsecontinue.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ifthenelsecontinue.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ifthenelsecontinue.wordpress.com&amp;blog=1401746&amp;post=10&amp;subd=ifthenelsecontinue&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ifthenelsecontinue.wordpress.com/2008/01/09/javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/79a16a851b2db78ef2fd415a38396d00?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lmen32</media:title>
		</media:content>
	</item>
		<item>
		<title>IE 6 tag script para incluir ficheiros javascript</title>
		<link>http://ifthenelsecontinue.wordpress.com/2008/01/07/ie-6-tag-script-para-incluir-ficheiros-javascript/</link>
		<comments>http://ifthenelsecontinue.wordpress.com/2008/01/07/ie-6-tag-script-para-incluir-ficheiros-javascript/#comments</comments>
		<pubDate>Mon, 07 Jan 2008 22:38:25 +0000</pubDate>
		<dc:creator>lmen32</dc:creator>
				<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://ifthenelsecontinue.wordpress.com/2008/01/07/ie-6-tag-script-para-incluir-ficheiros-javascript/</guid>
		<description><![CDATA[O IE6 e se calhar o IE7 pode ter um comportamento estranho quando é feita a inclusão de um ficheiro javascript numa página HTML. Tem tudo a haver com a forma com a tag &#60;script&#62; é fechada. Ela tem de ser sempre fechada com a tag &#60;/script&#62;. ex: Correcto: &#60;script type=&#8221;text/javascript&#8221; src=&#8221;prototype.js&#8221; &#62;&#60;/script&#62; Incorrecto mesmo [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ifthenelsecontinue.wordpress.com&amp;blog=1401746&amp;post=9&amp;subd=ifthenelsecontinue&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>O IE6 e se calhar o IE7 pode ter um comportamento estranho quando é feita a inclusão de um ficheiro javascript numa página HTML. Tem tudo a haver com a forma com a tag &lt;script&gt; é fechada. Ela tem de ser sempre fechada com a tag &lt;/script&gt;. ex:</p>
<p>Correcto:  &lt;script type=&#8221;text/javascript&#8221; src=&#8221;prototype.js&#8221; &gt;&lt;/script&gt;</p>
<p>Incorrecto mesmo estando certo do ponto de vista de xml, dá erros estranhos do tipo overflow na linha xxx : &lt;script type=&#8221;text/javascript&#8221; src=&#8221;prototype.js&#8221; /&gt;</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ifthenelsecontinue.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ifthenelsecontinue.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ifthenelsecontinue.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ifthenelsecontinue.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ifthenelsecontinue.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ifthenelsecontinue.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ifthenelsecontinue.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ifthenelsecontinue.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ifthenelsecontinue.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ifthenelsecontinue.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ifthenelsecontinue.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ifthenelsecontinue.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ifthenelsecontinue.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ifthenelsecontinue.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ifthenelsecontinue.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ifthenelsecontinue.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ifthenelsecontinue.wordpress.com&amp;blog=1401746&amp;post=9&amp;subd=ifthenelsecontinue&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ifthenelsecontinue.wordpress.com/2008/01/07/ie-6-tag-script-para-incluir-ficheiros-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/79a16a851b2db78ef2fd415a38396d00?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lmen32</media:title>
		</media:content>
	</item>
		<item>
		<title>Unicode</title>
		<link>http://ifthenelsecontinue.wordpress.com/2007/12/23/unicode/</link>
		<comments>http://ifthenelsecontinue.wordpress.com/2007/12/23/unicode/#comments</comments>
		<pubDate>Sun, 23 Dec 2007 22:55:25 +0000</pubDate>
		<dc:creator>lmen32</dc:creator>
				<category><![CDATA[unicode]]></category>

		<guid isPermaLink="false">http://ifthenelsecontinue.wordpress.com/2007/12/23/unicode/</guid>
		<description><![CDATA[Unicode Antes do aparecimento do Unicode a forma como os caracteres e símbolos das linguagens humanas eram codificados no computador não era realizada da mesma maneira. As linguagens latinas seguiam a regra de um byte por cada carácter cujo valor é atribuído por uma tabela de caracteres pré-definida como a ASCII ou a ISO-8859-1. Nas [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ifthenelsecontinue.wordpress.com&amp;blog=1401746&amp;post=8&amp;subd=ifthenelsecontinue&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p align="center"><strong>Unicode</strong></p>
<p>Antes do aparecimento do Unicode a forma como os caracteres e símbolos das linguagens humanas eram codificados no computador não era realizada da mesma maneira. As linguagens latinas seguiam a regra de um byte por cada carácter cujo valor é atribuído por uma tabela de caracteres pré-definida como a ASCII ou a ISO-8859-1. Nas linguagens orientais devido ao elevado número de caracteres cada é codificado por  múltiplos bytes de acordo com um standard. Para além da quantidade de bytes outra diferença impostas pelas linguagens é a sua orientação de escrita: os ocidentais seguem na sua maioria a orientação da esquerda para a direita enquanto outras linguagens impõe a orientação inversas ou mesmo a orientação de cima para baixo.</p>
<p>Estas diferenças dificultam o processamento informático de textos que têm de combinar diversas linguagens . Para solucionar este problema foi desenvolvido o <strong>Unicode</strong> por forma a definir uma tabela contendo os caracteres de todas as linguagens e algoritmos que permitem misturar pedaços de textos escritos em linguagens diferentes para definir um todo que seja tratável por um computador.</p>
<h2>Tabela de caracteres</h2>
<p>A tabela de caracteres do Unicode representa caracteres e não as suas representações gráficas (claro que na tabela de caracteres há uma representação gráfica do mesmo de forma a ser mais fácil a sua identificação). A representação gráfica de cada carácter Unicode é da responsabilidade do designer de fontes para computador. Além dos caracteres presentes nos alfabetos das linguagens mundiais como as latinas, as árabes, a cirilica, a grega, a chinesa, a japonesa, a coreana entre outras há outros caracteres provenientes de notações como a matemática, a música, musica bizantina, Braille, etc,.</p>
<p>Cada carácter no Unicode tem o nome de <strong>code element</strong> e é identificado por um valor numérico a que se dá o nome de <strong>codepoint</strong>. Também é caracterizado por um nome unívoco, uma abreviação e por várias propriedades, entre elas as mais importantes são:</p>
<ul>
<li>Categoria, isto é, se é 	número ou uma letra, ou um simbolo,</li>
<li>O seu valor numérico se tal 	for aplicável,</li>
<li>Indicação se é 	uma letra maiúscula, minúscula ou se só é 	maiúscula no inicio de uma palavra</li>
<li>Tipo, isto é, se é 	um carácter base, um carácter de combinação, 	 um carácter de formato &#8211; (por exemplo, indicação 	de mudança de linha )  ou um carácter de controle (por 	exemplo, permitem controlar a orientação do texto).</li>
</ul>
<p>Dada a quantidade de informação associada a cada carácter ser muito grande o consorcium Unicode distribui essa informação em vários ficheiros de texto a que se dá o nome de <strong>Unicode Character Database</strong> (UCD).</p>
<p>Desde a versão 3 do Unicode, a mais recente é a 5, que cada carácter da tabela Unicode é representado por um conjunto de <strong>32bits. </strong>A actual versão define 99089 caracteres pertencentes a alfabetos mundiais e a diversas notações. O intervalo de valores disponíveis para os codepoints é chamado de <strong>codespace</strong>, estando definido da seguinte forma:  [0, D7FF]  e [E000, 10FFFFF], existindo por isso 1 114 112 codepoints possíveis de serem atribuídos a code elements.</p>
<p>Numa tentativa de organizar os mais de 99 mil caracteres a especificação Unicode agrupa os caracteres de acordo com a linguagem ou notação a que pertencem, dividindo assim logicamente as secções do codespace. A cada divisão chama-se um <strong>Script</strong>.</p>
<p>Os actuais scripts do Unicode são (primeiro é apresentado o intervalo de codepoints e depois o nome do script):</p>
<p><strong>0000..007F; Basic Latin<br />
0080..00FF; Latin-1 Supplement<br />
0100..017F; Latin Extended-A<br />
0180..024F; Latin Extended-B<br />
0250..02AF; IPA Extensions<br />
02B0..02FF; Spacing Modifier Letters<br />
0300..036F; Combining Diacritical Marks</strong><br />
0370..03FF; Greek and Coptic<br />
0400..04FF; Cyrillic<br />
0500..052F; Cyrillic Supplement<br />
0530..058F; Armenian<br />
0590..05FF; Hebrew<br />
0600..06FF; Arabic<br />
0700..074F; Syriac<br />
0750..077F; Arabic Supplement<br />
0780..07BF; Thaana<br />
07C0..07FF; NKo<br />
0900..097F; Devanagari<br />
0980..09FF; Bengali<br />
0A00..0A7F; Gurmukhi<br />
0A80..0AFF; Gujarati<br />
0B00..0B7F; Oriya<br />
0B80..0BFF; Tamil<br />
0C00..0C7F; Telugu<br />
0C80..0CFF; Kannada<br />
0D00..0D7F; Malayalam<br />
0D80..0DFF; Sinhala<br />
0E00..0E7F; Thai<br />
0E80..0EFF; Lao<br />
0F00..0FFF; Tibetan<br />
1000..109F; Myanmar<br />
10A0..10FF; Georgian<br />
1100..11FF; Hangul Jamo<br />
1200..137F; Ethiopic<br />
1380..139F; Ethiopic Supplement<br />
13A0..13FF; Cherokee<br />
1400..167F; Unified Canadian Aboriginal Syllabics<br />
1680..169F; Ogham<br />
16A0..16FF; Runic<br />
1700..171F; Tagalog<br />
1720..173F; Hanunoo<br />
1740..175F; Buhid<br />
1760..177F; Tagbanwa<br />
1780..17FF; Khmer<br />
1800..18AF; Mongolian<br />
1900..194F; Limbu<br />
1950..197F; Tai Le<br />
1980..19DF; New Tai Lue<br />
19E0..19FF; Khmer Symbols<br />
1A00..1A1F; Buginese<br />
1B00..1B7F; Balinese<br />
1D00..1D7F; Phonetic Extensions<br />
1D80..1DBF; Phonetic Extensions Supplement<br />
1DC0..1DFF; Combining Diacritical Marks Supplement<br />
1E00..1EFF; Latin Extended Additional<br />
1F00..1FFF; Greek Extended<br />
2000..206F; General Punctuation<br />
2070..209F; Superscripts and Subscripts<br />
<strong>20A0..20CF; Currency Symbols</strong><br />
20D0..20FF; Combining Diacritical Marks for Symbols<br />
2100..214F; Letterlike Symbols<br />
2150..218F; Number Forms<br />
2190..21FF; Arrows<br />
2200..22FF; Mathematical Operators<br />
2300..23FF; Miscellaneous Technical<br />
2400..243F; Control Pictures<br />
2440..245F; Optical Character Recognition<br />
2460..24FF; Enclosed Alphanumerics<br />
2500..257F; Box Drawing<br />
2580..259F; Block Elements<br />
25A0..25FF; Geometric Shapes<br />
2600..26FF; Miscellaneous Symbols<br />
2700..27BF; Dingbats<br />
27C0..27EF; Miscellaneous Mathematical Symbols-A<br />
27F0..27FF; Supplemental Arrows-A<br />
2800..28FF; Braille Patterns<br />
2900..297F; Supplemental Arrows-B<br />
2980..29FF; Miscellaneous Mathematical Symbols-B<br />
2A00..2AFF; Supplemental Mathematical Operators<br />
2B00..2BFF; Miscellaneous Symbols and Arrows<br />
2C00..2C5F; Glagolitic<br />
2C60..2C7F; Latin Extended-C<br />
2C80..2CFF; Coptic<br />
2D00..2D2F; Georgian Supplement<br />
2D30..2D7F; Tifinagh<br />
2D80..2DDF; Ethiopic Extended<br />
2E00..2E7F; Supplemental Punctuation<br />
2E80..2EFF; CJK Radicals Supplement<br />
2F00..2FDF; Kangxi Radicals<br />
2FF0..2FFF; Ideographic Description Characters<br />
3000..303F; CJK Symbols and Punctuation<br />
3040..309F; Hiragana<br />
30A0..30FF; Katakana<br />
3100..312F; Bopomofo<br />
3130..318F; Hangul Compatibility Jamo<br />
3190..319F; Kanbun<br />
31A0..31BF; Bopomofo Extended<br />
31C0..31EF; CJK Strokes<br />
31F0..31FF; Katakana Phonetic Extensions<br />
3200..32FF; Enclosed CJK Letters and Months<br />
3300..33FF; CJK Compatibility<br />
3400..4DBF; CJK Unified Ideographs Extension A<br />
4DC0..4DFF; Yijing Hexagram Symbols<br />
4E00..9FFF; CJK Unified Ideographs<br />
A000..A48F; Yi Syllables<br />
A490..A4CF; Yi Radicals<br />
A700..A71F; Modifier Tone Letters<br />
A720..A7FF; Latin Extended-D<br />
A800..A82F; Syloti Nagri<br />
A840..A87F; Phags-pa<br />
AC00..D7AF; Hangul Syllables<br />
D800..DB7F; High Surrogates<br />
DB80..DBFF; High Private Use Surrogates<br />
DC00..DFFF; Low Surrogates<br />
E000..F8FF; Private Use Area<br />
F900..FAFF; CJK Compatibility Ideographs<br />
FB00..FB4F; Alphabetic Presentation Forms<br />
FB50..FDFF; Arabic Presentation Forms-A<br />
FE00..FE0F; Variation Selectors<br />
FE10..FE1F; Vertical Forms<br />
FE20..FE2F; Combining Half Marks<br />
FE30..FE4F; CJK Compatibility Forms<br />
FE50..FE6F; Small Form Variants<br />
FE70..FEFF; Arabic Presentation Forms-B<br />
FF00..FFEF; Halfwidth and Fullwidth Forms<br />
FFF0..FFFF; Specials<br />
10000..1007F; Linear B Syllabary<br />
10080..100FF; Linear B Ideograms<br />
10100..1013F; Aegean Numbers<br />
10140..1018F; Ancient Greek Numbers<br />
10300..1032F; Old Italic<br />
10330..1034F; Gothic<br />
10380..1039F; Ugaritic<br />
103A0..103DF; Old Persian<br />
10400..1044F; Deseret<br />
10450..1047F; Shavian<br />
10480..104AF; Osmanya<br />
10800..1083F; Cypriot Syllabary<br />
10900..1091F; Phoenician<br />
10A00..10A5F; Kharoshthi<br />
12000..123FF; Cuneiform<br />
12400..1247F; Cuneiform Numbers and Punctuation<br />
1D000..1D0FF; Byzantine Musical Symbols<br />
1D100..1D1FF; Musical Symbols<br />
1D200..1D24F; Ancient Greek Musical Notation<br />
1D300..1D35F; Tai Xuan Jing Symbols<br />
1D360..1D37F; Counting Rod Numerals<br />
1D400..1D7FF; Mathematical Alphanumeric Symbols<br />
20000..2A6DF; CJK Unified Ideographs Extension B<br />
2F800..2FA1F; CJK Compatibility Ideographs Supplement<br />
E0000..E007F; Tags<br />
E0100..E01EF; Variation Selectors Supplement<br />
F0000..FFFFF; Supplementary Private Use Area-A<br />
100000..10FFFF; Supplementary Private Use Area-B</p>
<p>Os caracteres cujo code point pode ser codificados por 16 bits (entre 0 e 65536) estão no plano  <strong>Basic Multilingual Plane</strong> (BMP), correspondendo aos scripts da maioria das linguagens humanas.</p>
<p>O Unicode foi desenhado para ser compatível com algumas codificações já existentes como o código ASCII ou o ISO-8859-1, pelo que os primeiros 255 caracteres são idênticos a esses dois códigos, por exemplo a letra A tem o valor 65(dec) no Unicode, no ASCII e no ISO-8859-1.</p>
<p>Para além dos caracteres das linguagens humanas também estão definidos caracteres que permitem ao computador identificar onde começa uma palavra, uma linha ou um paragrafo, são os chamados caracteres de controlo. A seguir identifica-se alguns dos caracteres de controlo mais importantes:</p>
<p>Caracteres para mudança de linha e de paragrafo:</p>
<table border="1" cellspacing="0" cellpadding="4" width="404">
<tbody>
<tr valign="top">
<td width="119">
<p align="left"><strong>Acronym 			Name</strong></p>
</td>
<td width="120">
<p align="left"><strong>Unicode </strong></p>
</td>
<td width="138">
<p align="left"><strong>ASCII </strong></p>
</td>
</tr>
</tbody>
</table>
<p>O Unicode define dois caracteres para delimitar linhas e parágrafos. O seu uso não é obrigatório uma vez que também estão definidos os caracteres usados pelo código ASCII para separar linhas. Note-se que no mundo Windows a mudança de linha é identificada pelo par CRLF ao passo que no UNIX a mudança de linha é indicada apenas por LF.</p>
<p>Caracteres identificadores de espaço</p>
<table border="1" cellspacing="0" cellpadding="4" width="100%">
<tbody>
<tr valign="top">
<td width="24%"><strong>Code </strong></td>
<td width="76%"><strong>Name</strong></td>
</tr>
</tbody>
</table>
<p>Caracteres que permitem controlar a direcção do texto, isto é, se ele flui da esquerda para a direita ou vice-versa. São usados quando há uma combinação de texto bi-direccional, senão o seu uso não é obrigatório.</p>
<table border="1" cellspacing="0" cellpadding="4" width="100%">
<tbody>
<tr valign="top">
<td width="27%"><strong>Code </strong></td>
<td width="36%"><strong>Name </strong></td>
<td width="38%"><strong>Abbreviation</strong></td>
</tr>
</tbody>
</table>
<p>O carácter do euro € tem o codepoint U+20AC</p>
<p>Composição de caracteres</p>
<p>Uma diferença do Unicode para os códigos ASCII e ISO-8859-1 é que permite a composição dinâmica de caracteres, isto é, um conjunto de caracteres Unicode combinados entre si podem definir um novo carácter que não está presente na tabela de caracteres. Esta funcionalidade é útil para suportar as linguagens asiáticas. Contudo, do ponto de vista de programação a composição de caracteres elimina a regra &#8220;um carácter por cada unidade de codificação&#8221; que é valida desde os tempos do ASCII.  Para programas pensados para serem executados apenas no Ocidente a regra continua a ser válida uma vez que não é necessário a composição de caracteres para estas linguagens.</p>
<p>Para combinar caracteres é necessário ter um carácter &#8220;base&#8221; e um ou mais caracteres &#8220;combinantes&#8221;. Os caracteres combinantes são aplicados sempre ao carácter base que se apresente à sua esquerda, por exemplo: A sequência de codepoints &lt;U0041 U0307&gt; resulta no caractere  Ä, uma vez que o U0041 é o caracteres base <strong>A</strong> e U0307 é caracter combinante <strong>¨</strong>.</p>
<p>Do exemplo anterior e de uma inspecção à tabela de códigos do Unicode chega-se à conclusão que já existe o carácter Ä com o codepoint 00C4. Tal facto, deve-se como já foi mencionado anteriormente, de o Unicode suportar standards já existentes como o ASCII ou o ISO-8859-1.</p>
<p>Quando um carácter com um codepoint atribuído é igual a um carácter obtidos através de combinação diz-se que ocorreu uma <strong>equivalência</strong>.</p>
<p>Encoding</p>
<p>Como os computadores só entendem conjuntos de bits que podem ter o tamanho de  8, 16, 32 e mais recentemente em 64 o standard Unicode definiu de uma forma clara como representar cada codepoint da tabela de caracteres nos diversos tamanhos. São as chamadas <strong>codificações</strong> (<strong>encodings</strong>). O standard especifica três:</p>
<ul>
<li><strong>UTF-8</strong>: transforma um 	codepoint numa sequência de tamanho variável de bytes 	(conjunto de 8 bits).</li>
<li><strong>UTF-16</strong>: transforma um 	codepoint num ou em dois conjuntos de words (conjunto de 16 bits)</li>
<li><strong>UTF-32</strong>: transforma um 	codepoint num único conjunto de 32 bits.</li>
</ul>
<p>Independente de cada forma de codificação, há a garantia de cada carácter Unicode ser codificado por uma sequência com no máximo 4 conjuntos (bytes).</p>
<p>A sigla <strong>UTF</strong> significa <strong>Unicode Transformation Format</strong>.</p>
<p>A seguinte tabela ilustra os valores das três codificações para quatro caracteres dispersos no codespace do Unicode (os valores estão em hexadecimal e o espaço delimita cada conjunto de bits).</p>
<p>.</p>
<table border="1" cellspacing="0" cellpadding="4" width="100%">
<tbody>
<tr valign="top">
<td width="20%">
<p align="center"><strong>Carácter</strong></p>
</td>
<td width="20%">
<p align="center"><strong>A</strong></p>
</td>
<td width="20%">
<p align="center"><strong>Ω</strong></p>
</td>
<td width="20%">
<p align="center"><strong>representação indisponível</strong></p>
</td>
<td width="20%">
<p align="center"><strong>representação indisponível</strong></p>
</td>
</tr>
</tbody>
</table>
<p>Como pode ser observado, em algumas situações os valores de UTF-16 e UTF-8 não são iguais ao valor do codepoint codificado. Tal facto está  relacionado com as regras de cada codificação, que são:</p>
<p>Para a codificação UTF-32:</p>
<ul>
<li>os codepoints são 	codificados directamente em 32 bits sendo bem formado se estiver 	entre os valores do codespace Unicode: [0, D7FF] ou [E000 e 10FFFF]</li>
</ul>
<p>Para a codificação UTF-16:</p>
<ul>
<li>os codepoints entre [0000 e FFFF] 	(hex), com um número menor que 16bits, são 	representados directamente numa única Word.</li>
<li>os codepoints entre 10000(hex) e 	10FFFF(hex) são representados através de duas words 	usando a seguinte regra:
<ul>
<li>O valor binário de um 		codepoint na forma  000uuuuuxxxxxxxxxxxxxxxx é codificado em 		duas words: A primeira constituída por 110110wwwwxxxxxx e a 		segunda por 110111xxxxxxxxxx, onde wwww=uuuuu-1</li>
</ul>
</li>
</ul>
<p>Para o UTF-8 (&lt;NU&gt; = Não usado):</p>
<table border="1" cellspacing="0" cellpadding="4" width="100%">
<tbody>
<tr valign="top">
<td width="39%">Codepoint</td>
<td width="15%">1º byte</td>
<td width="15%">2ºbyte</td>
<td width="15%">3ºbyte</td>
<td width="16%">4ºbyte</td>
</tr>
</tbody>
</table>
<p>As codificações UTF-16 e UTF-32 tem variantes para acomodar o tipo de processador que codificou o texto, ou seja se ele é Big-Endien (onde o byte mais significativo é colocado primeiro) ou Litle-Endien (onde o byte menos significativo é colocado primeiro).  As codificações para estes casos chamam-se UTF-16-LE, UTF-32-LE,  UTF-16-BE, UTF-32-BE e seguem as regras de codificações descritas anteriormente para o UTF-16 e UTF-32. A única diferença é a ordem dos bytes obtidos como resultado da codificação. A codificação UTF-8 não tem variante BE ou LE porque os bits de um byte são processados pela mesma ordem em todas as arquitecturas.</p>
<p>As codificações UTF-16 e UTF-32 levantam um problema de interpretação porque não indicam qual a ordem de leitura dos bytes, ao contrario das codificações UTF-16-BE, UTF-16-LE, UTF-32-BE e UTF-32-LE que especificam claramente a sua ordem. Para resolver este problema, o Unicode definiu o carácter Byte Order Mark (BOM) com o codepoint UFEFF que permite identificar a ordem de leitura dos bytes das codificações UTF-16 e UTF-32.</p>
<p>A inclusão do BOM não é obrigatório, o que nesse caso deixa à consideração da aplicação leitora  a interpretação da ordem de leitura dos bytes, embora haja a tendência de ser interpretada como  big-endien.</p>
<p>O BOM quando usado para identificar a ordem deve surgir antes da informação codificada (deve ser o primeiro carácter) e dependendo da ordem de bytes usada na codificação o seu valor identifica o ardem de codificação, assim, se o seu valor é :</p>
<ul>
<li>U+FEFF 	identifica que a informação está codificada na 	ordem litle-endien</li>
<li>U+FFFE 	indica a ordem big-enfien.</li>
</ul>
<p>As codificações UTF-16BE, UTF-16LE, UTF-32BE e UTF-32LE não necessitam do BOM porque a ordem dos byte é explicitada pelos sufixos BE (Big-endien) e LE (little-endien).</p>
<p>A seguinte tabela demonstra a codificação de um único codepoint nas várias variantes da UTF-16</p>
<p align="left">
<table border="1" cellspacing="0" cellpadding="4" width="328">
<tbody>
<tr valign="top">
<td width="82">
<p align="left">Codepoint</p>
</td>
<td width="92">
<p align="left">Codificação</p>
</td>
<td width="128">
<p align="left">Valor</p>
</td>
</tr>
</tbody>
</table>
<p>Um efeito colateral interessante do uso do BOM é que permite implicitamente identificar que a informação seguinte são caracteres Unicode, embora tal detecção não seja fiável uma vez que o standard não obriga o seu uso. Na codificação UTF-8 o BOM é expresso pela sequência &lt;EF BB BF&gt;, não tendo qualquer significado a não ser que é provável que a informação a seguir seja texto Unicode.</p>
<p>Ordenação e pesquisa de caracteres</p>
<p>O critério de ordenação de caracteres não é uniforme entre as diversas linguagens. Cada uma tem as suas particularidades devido à posição a que atribui aos caracteres do seu alfabeto, como ordena os caracteres com acento ou como ordena os caracteres na forma maiúscula ou na forma minúscula.</p>
<p><strong>Collation</strong> é o termo dado à forma como duas string são comparadas de forma a determinar qual a menor e a maior.</p>
<p>No Unicode não se podem comparar Strings de caracteres através da comparação directa do valor do codepoint de cada carácter.</p>
<p>Para comparar String Unicode deve-se usar o Algoritmo  &#8220;Unicode Colaction Algorithm&#8221; que através de uma Collation Element Table consegue ordena as strings. O standard Unicode define a Default Unicode Collation Element Table, como sendo a tabela a usar com o algoritmo.</p>
<p>A tabela Collation Element Table também é usada na operação de pesquisa de caracteres.</p>
<p>Visualização de texto e a Bidireccionalidade</p>
<p>Quando é necessário misturar texto de linguagens com diferentes orientações tem de haver uma maneira de identificar onde começa e acaba cada orientação. Para tal, na tabela de caracteres Unicode há caracteres de controlo caracterizadores da orientação e que devem ser usados de acordo com o algoritmo &#8220;Bidireccional Algorithm&#8221;.</p>
<p>Os caracteres de controlo só tem influência para a operação de visualização do texto e tem um âmbito de acção somente no paragrafo em que estão presentes. Estes caracteres não têm  importância para outros aspectos do texto.  Cada paragrafo pode ser delimitado por um carácter de controlo que existe no Unicode.</p>
<p>De uma forma simplista o algoritmo da bidirecionalidade obriga a que o texto com uma determinada  orientação começe com o carácter de controlo identificador da orientação, que pode ser o  RLE para  o sentido direita-esquerda ou o LRE o para o sentido esquerda-direita, seguido dos caracteres de texto a ser visualizados terminando com o carácter de controlo de fim de paragrafo ou com o carácter de controlo PDF (Pop Directional Format ) que anula a ultima orientação dada por RLE ou LRE.</p>
<p>Conclusão</p>
<p>O standard Unicode ao contrário do simples código ASCII ou ISO-8859-1 não é só uma simples tabela gigante com todos os caracteres usados pelas linguagens mundiais, também, apresenta  algoritmos que permitem do ponto de vista linguístico processar o texto de acordo com a convenção de cada país e idioma. A título ilustrativo, para além dos já mencionados algoritmos de ordenação, visualização há outros que permitem identificar os limites de um carácter, de uma palavra, de uma frase ou mesmo de um paragrafo.</p>
<p>Referências:</p>
<ul>
<li>Tabela 	de caracteres do Unicode 5.0: 	<a title="Unicode 5.0 Code Charts" name="Unicode 5.0 Code Charts" href="http://www.unicode.org/Public/5.0.0/charts/CodeCharts.pdf" target="_blank">http://www.unicode.org/Public/5.0.0/charts/CodeCharts.pdf</a></li>
<li>Unicode 	Chart Database do Unicode 5.0: 	<a title="Unicode 5.0 Code Charts" href="http://www.unicode.org/Public/5.0.0/ucd/" target="_blank">http://www.unicode.org/Public/5.0.0/ucd/</a></li>
<li>Livro 	Oficial do standard Unicode 5.0: 	<a title="Livro Unicode 5.0" name="Livro Unicode 5.0" href="http://www.unicode.org/versions/Unicode5.0.0/" target="_blank">http://www.unicode.org/versions/Unicode5.0.0/</a></li>
</ul>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ifthenelsecontinue.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ifthenelsecontinue.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ifthenelsecontinue.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ifthenelsecontinue.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ifthenelsecontinue.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ifthenelsecontinue.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ifthenelsecontinue.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ifthenelsecontinue.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ifthenelsecontinue.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ifthenelsecontinue.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ifthenelsecontinue.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ifthenelsecontinue.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ifthenelsecontinue.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ifthenelsecontinue.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ifthenelsecontinue.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ifthenelsecontinue.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ifthenelsecontinue.wordpress.com&amp;blog=1401746&amp;post=8&amp;subd=ifthenelsecontinue&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ifthenelsecontinue.wordpress.com/2007/12/23/unicode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/79a16a851b2db78ef2fd415a38396d00?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lmen32</media:title>
		</media:content>
	</item>
		<item>
		<title>O Símbolo euro e os encodings de JAVA</title>
		<link>http://ifthenelsecontinue.wordpress.com/2007/12/10/o-simbolo-euro-e-os-encodings-de-java/</link>
		<comments>http://ifthenelsecontinue.wordpress.com/2007/12/10/o-simbolo-euro-e-os-encodings-de-java/#comments</comments>
		<pubDate>Mon, 10 Dec 2007 23:59:06 +0000</pubDate>
		<dc:creator>lmen32</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://ifthenelsecontinue.wordpress.com/2007/12/10/o-simbolo-euro-e-os-encodings-de-java/</guid>
		<description><![CDATA[O símbolo do euro € é sobejamente conhecido mas levanta enormes dores de cabeça quando é necessário transferir a sua representação entre aplicações ou dentro da mesma aplicação quando a representação é guardada num conjuntos de bytes, por exemplo, um ficheiro ou array. A linguagem JAVA considera todos os caracteres de uma string como pertencendo [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ifthenelsecontinue.wordpress.com&amp;blog=1401746&amp;post=7&amp;subd=ifthenelsecontinue&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>O símbolo do euro <strong>€</strong> é sobejamente conhecido mas levanta enormes dores de cabeça quando é necessário transferir a sua representação entre aplicações ou dentro da mesma aplicação quando a representação é guardada num conjuntos de bytes, por exemplo, um ficheiro ou array.</p>
<p>A linguagem JAVA considera todos os caracteres de uma string como pertencendo ao úniverso de codepoints (numa forma simplista um codepoint corresponde a um caracter do código ASCII) da especificação <strong>Unicode</strong>. No <strong>Unicode </strong>o símbolo € está atribuído ao codepoint <strong>20</strong><span><strong>AChex</strong> </span> que ultrapassa em muito os 255 valores da tabela ASCII ou da tabela que actualmente é mais usada no nosso país o ISO-8859-1. Na prática a tabela ISO-8859-1  corresponde aos primeiros 255 simbolos da Unicode, por isso, se o universo de caracteres usados por uma aplicação corresponder apenas aos símbolos do ISO-8859-1 pode-se representar cada caracter de uma String num único byte. Iste estratagema serve para o os caracteres acentuados, por exemplo, mas não para o símbolo do euro, que não faz parte do alfabeto do ISO-8859-1</p>
<p><img src="http://htmlhelp.com/reference/charset/latin1.gif" border="1" alt="Alfabeto do ISO-8859-1" width="1143" height="1530" align="middle" /></p>
<p>Portanto, quando for necessário gravar uma String contento o símbolo do Euro num conjunto de bytes, deve-se codificar os caracteres usando os métodos oficiais do Unicode: <strong>UTF-8</strong>, <strong>UTF-16</strong>, <strong>UTF-32</strong> ou recorrendo a alfabetos que contenham os caracteres normal do alfabeto português e o símbolo do euro. Os alfabetos candidatos são: <strong>ISO-8859-15</strong> onde o símbolo do euro tem o valor de <strong>A4</strong>hex (O ISO-8859-15 é uma actualização do ISO-8859-1 onde uns quantos caracteres menos usados foram substituídos por outros que faziam falta como por exemplo o €) ou o <strong>CP1252</strong> do windows onde o euro ocupa o lugar de <strong>80hex</strong>.</p>
<table class="wikitable" style="text-align:center;border-collapse:collapse;" border="0">
<tbody>
<tr>
<th colspan="17" align="center">Windows-1252 (CP1252)</th>
</tr>
<tr>
<th></th>
<th>x0</th>
<th>x1</th>
<th>x2</th>
<th>x3</th>
<th>x4</th>
<th>x5</th>
<th>x6</th>
<th>x7</th>
<th>x8</th>
<th>x9</th>
<th>xA</th>
<th>xB</th>
<th>xC</th>
<th>xD</th>
<th>xE</th>
<th>xF</th>
</tr>
<tr>
<th>0x</th>
<td style="text-decoration:underline;"><a title="Null character" href="http://en.wikipedia.org/wiki/Null_character">NUL</a><br />
<em><strong>0</strong></em></td>
<td style="text-decoration:underline;">SOH<br />
<em><strong>1</strong></em></td>
<td style="text-decoration:underline;">STX<br />
<em><strong>2</strong></em></td>
<td style="text-decoration:underline;">ETX<br />
<em><strong>3</strong></em></td>
<td style="text-decoration:underline;">EOT<br />
<em><strong>4</strong></em></td>
<td style="text-decoration:underline;">ENQ<br />
<em><strong>5</strong></em></td>
<td style="text-decoration:underline;">ACK<br />
<em><strong>6</strong></em></td>
<td style="text-decoration:underline;"><a title="Bell character" href="http://en.wikipedia.org/wiki/Bell_character">BEL</a><br />
<em><strong>7</strong></em></td>
<td style="text-decoration:underline;"><a title="Backspace" href="http://en.wikipedia.org/wiki/Backspace">BS</a><br />
<em><strong>8</strong></em></td>
<td style="text-decoration:underline;"><a title="Tab" href="http://en.wikipedia.org/wiki/Tab">TAB</a><br />
<em><strong>9</strong></em></td>
<td style="text-decoration:underline;"><a title="Line feed" href="http://en.wikipedia.org/wiki/Line_feed">LF</a><br />
<em><strong>10</strong></em></td>
<td style="text-decoration:underline;">VT<br />
<em><strong>11</strong></em></td>
<td style="text-decoration:underline;"><a title="Form Feed" href="http://en.wikipedia.org/wiki/Form_Feed">FF</a><br />
<em><strong>12</strong></em></td>
<td style="text-decoration:underline;"><a title="Carriage Return" href="http://en.wikipedia.org/wiki/Carriage_Return">CR</a><br />
<em><strong>13</strong></em></td>
<td style="text-decoration:underline;">SO<br />
<em><strong>14</strong></em></td>
<td style="text-decoration:underline;">SI<br />
<em><strong>15</strong></em></td>
</tr>
<tr>
<th>1x</th>
<td style="text-decoration:underline;">DLE<br />
<em><strong>16</strong></em></td>
<td style="text-decoration:underline;">DC1<br />
<em><strong>17</strong></em></td>
<td style="text-decoration:underline;">DC2<br />
<em><strong>18</strong></em></td>
<td style="text-decoration:underline;">DC3<br />
<em><strong>19</strong></em></td>
<td style="text-decoration:underline;">DC4<br />
<em><strong>20</strong></em></td>
<td style="text-decoration:underline;">NAK<br />
<em><strong>21</strong></em></td>
<td style="text-decoration:underline;">SYN<br />
<em><strong>22</strong></em></td>
<td style="text-decoration:underline;">ETB<br />
<em><strong>23</strong></em></td>
<td style="text-decoration:underline;">CAN<br />
<em><strong>24</strong></em></td>
<td style="text-decoration:underline;">EM<br />
<em><strong>25</strong></em></td>
<td style="text-decoration:underline;"><a title="Substitute character" href="http://en.wikipedia.org/wiki/Substitute_character">SUB</a><br />
<em><strong>26</strong></em></td>
<td style="text-decoration:underline;"><a title="Escape character" href="http://en.wikipedia.org/wiki/Escape_character">ESC</a><br />
<em><strong>27</strong></em></td>
<td style="text-decoration:underline;">FS<br />
<em><strong>28</strong></em></td>
<td style="text-decoration:underline;">GS<br />
<em><strong>29</strong></em></td>
<td style="text-decoration:underline;">RS<br />
<em><strong>30</strong></em></td>
<td style="text-decoration:underline;">US<br />
<em><strong>31</strong></em></td>
</tr>
<tr>
<th>2x</th>
<td style="text-decoration:underline;"><a title="Space character" href="http://en.wikipedia.org/wiki/Space_character">SP</a><br />
<em><strong>32</strong></em></td>
<td><a title="Exclamation mark" href="http://en.wikipedia.org/wiki/Exclamation_mark">!</a><br />
<em><strong>33</strong></em></td>
<td><a title="Quotation mark" href="http://en.wikipedia.org/wiki/Quotation_mark">&#8220;</a><br />
<em><strong>34</strong></em></td>
<td><a title="Number sign" href="http://en.wikipedia.org/wiki/Number_sign">#</a><br />
<em><strong>35</strong></em></td>
<td><a title="Dollar sign" href="http://en.wikipedia.org/wiki/Dollar_sign">$</a><br />
<em><strong>36</strong></em></td>
<td><a title="Percent sign" href="http://en.wikipedia.org/wiki/Percent_sign">%</a><br />
<em><strong>37</strong></em></td>
<td><a title="&amp;" href="http://en.wikipedia.org/wiki/%26">&amp;</a><br />
<em><strong>38</strong></em></td>
<td><a title="'" href="http://en.wikipedia.org/wiki/%27">&#8216;</a><br />
<em><strong>39</strong></em></td>
<td><a title="Bracket" href="http://en.wikipedia.org/wiki/Bracket">(</a><br />
<em><strong>40</strong></em></td>
<td><a title="Bracket" href="http://en.wikipedia.org/wiki/Bracket">)</a><br />
<em><strong>41</strong></em></td>
<td><a title="Asterisk" href="http://en.wikipedia.org/wiki/Asterisk">*</a><br />
<em><strong>42</strong></em></td>
<td><a title="Plus and minus signs" href="http://en.wikipedia.org/wiki/Plus_and_minus_signs">+</a><br />
<em><strong>43</strong></em></td>
<td><a title="Comma (punctuation)" href="http://en.wikipedia.org/wiki/Comma_%28punctuation%29">,</a><br />
<em><strong>44</strong></em></td>
<td><a title="Plus and minus signs" href="http://en.wikipedia.org/wiki/Plus_and_minus_signs">-</a><br />
<em><strong>45</strong></em></td>
<td><a title="Full stop" href="http://en.wikipedia.org/wiki/Full_stop">.</a><br />
<em><strong>46</strong></em></td>
<td><a title="Slash (punctuation)" href="http://en.wikipedia.org/wiki/Slash_%28punctuation%29">/</a><br />
<em><strong>47</strong></em></td>
</tr>
<tr>
<th>3x</th>
<td>0<br />
<em><strong>48</strong></em></td>
<td>1<br />
<em><strong>49</strong></em></td>
<td>2<br />
<em><strong>50</strong></em></td>
<td>3<br />
<em><strong>51</strong></em></td>
<td>4<br />
<em><strong>52</strong></em></td>
<td>5<br />
<em><strong>53</strong></em></td>
<td>6<br />
<em><strong>54</strong></em></td>
<td>7<br />
<em><strong>55</strong></em></td>
<td>8<br />
<em><strong>56</strong></em></td>
<td>9<br />
<em><strong>57</strong></em></td>
<td>:<br />
<em><strong>58</strong></em></td>
<td>;<br />
<em><strong>59</strong></em></td>
<td>&lt;<br />
<em><strong>60</strong></em></td>
<td>=<br />
<em><strong>61</strong></em></td>
<td>&gt;<br />
<em><strong>62</strong></em></td>
<td>?<br />
<em><strong>63</strong></em></td>
</tr>
<tr>
<th>4x</th>
<td>@<br />
<em><strong>64</strong></em></td>
<td>A<br />
<em><strong>65</strong></em></td>
<td>B<br />
<em><strong>66</strong></em></td>
<td>C<br />
<em><strong>67</strong></em></td>
<td>D<br />
<em><strong>68</strong></em></td>
<td>E<br />
<em><strong>69</strong></em></td>
<td>F<br />
<em><strong>70</strong></em></td>
<td>G<br />
<em><strong>71</strong></em></td>
<td>H<br />
<em><strong>72</strong></em></td>
<td>I<br />
<em><strong>73</strong></em></td>
<td>J<br />
<em><strong>74</strong></em></td>
<td>K<br />
<em><strong>75</strong></em></td>
<td>L<br />
<em><strong>76</strong></em></td>
<td>M<br />
<em><strong>77</strong></em></td>
<td>N<br />
<em><strong>78</strong></em></td>
<td>O<br />
<em><strong>79</strong></em></td>
</tr>
<tr>
<th>5x</th>
<td>P<br />
<em><strong>80</strong></em></td>
<td>Q<br />
<em><strong>81</strong></em></td>
<td>R<br />
<em><strong>82</strong></em></td>
<td>S<br />
<em><strong>83</strong></em></td>
<td>T<br />
<em><strong>84</strong></em></td>
<td>U<br />
<em><strong>85</strong></em></td>
<td>V<br />
<em><strong>86</strong></em></td>
<td>W<br />
<em><strong>87</strong></em></td>
<td>X<br />
<em><strong>88</strong></em></td>
<td>Y<br />
<em><strong>89</strong></em></td>
<td>Z<br />
<em><strong>90</strong></em></td>
<td>[<br />
<em><strong>91</strong></em></td>
<td>\<br />
<em><strong>92</strong></em></td>
<td>]<br />
<em><strong>93</strong></em></td>
<td><a title="Caret" href="http://en.wikipedia.org/wiki/Caret">^</a><br />
<em><strong>94</strong></em></td>
<td><a title="Underscore" href="http://en.wikipedia.org/wiki/Underscore">_</a><br />
<em><strong>95</strong></em></td>
</tr>
<tr>
<th>6x</th>
<td>`<br />
<em><strong>96</strong></em></td>
<td>a<br />
<em><strong>97</strong></em></td>
<td>b<br />
<em><strong>98</strong></em></td>
<td>c<br />
<em><strong>99</strong></em></td>
<td>d<br />
<em><strong>100</strong></em></td>
<td>e<br />
<em><strong>101</strong></em></td>
<td>f<br />
<em><strong>102</strong></em></td>
<td>g<br />
<em><strong>103</strong></em></td>
<td>h<br />
<em><strong>104</strong></em></td>
<td>i<br />
<em><strong>105</strong></em></td>
<td>j<br />
<em><strong>106</strong></em></td>
<td>k<br />
<em><strong>107</strong></em></td>
<td>l<br />
<em><strong>108</strong></em></td>
<td>m<br />
<em><strong>109</strong></em></td>
<td>n<br />
<em><strong>110</strong></em></td>
<td>o<br />
<em><strong>111</strong></em></td>
</tr>
<tr>
<th>7x</th>
<td>p<br />
<em><strong>112</strong></em></td>
<td>q<br />
<em><strong>113</strong></em></td>
<td>r<br />
<em><strong>114</strong></em></td>
<td>s<br />
<em><strong>115</strong></em></td>
<td>t<br />
<em><strong>116</strong></em></td>
<td>u<br />
<em><strong>117</strong></em></td>
<td>v<br />
<em><strong>118</strong></em></td>
<td>w<br />
<em><strong>119</strong></em></td>
<td>x<br />
<em><strong>120</strong></em></td>
<td>y<br />
<em><strong>121</strong></em></td>
<td>z<br />
<em><strong>122</strong></em></td>
<td>{<br />
<em><strong>123</strong></em></td>
<td><a title="Pipe (computing)" href="http://en.wikipedia.org/wiki/Pipe_%28computing%29">|</a><br />
<em><strong>124</strong></em></td>
<td>}<br />
<em><strong>125</strong></em></td>
<td><a title="Tilde" href="http://en.wikipedia.org/wiki/Tilde">~</a><br />
<em><strong>126</strong></em></td>
<td style="text-decoration:underline;">DEL<br />
<em><strong>127</strong></em></td>
</tr>
<tr>
<th>Ax</th>
<td style="text-decoration:underline;"><a title="Non-breaking space" href="http://en.wikipedia.org/wiki/Non-breaking_space">NBSP</a><br />
<em><strong>160</strong></em></td>
<td><a title="Exclamation mark" href="http://en.wikipedia.org/wiki/Exclamation_mark">¡</a><br />
<em><strong>161</strong></em></td>
<td><a title="Cent (currency)" href="http://en.wikipedia.org/wiki/Cent_%28currency%29">¢</a><br />
<em><strong>162</strong></em></td>
<td><a title="Pound sign" href="http://en.wikipedia.org/wiki/Pound_sign">£</a><br />
<em><strong>163</strong></em></td>
<td><a title="Currency" href="http://en.wikipedia.org/wiki/Currency">¤</a><br />
<em><strong>164</strong></em></td>
<td><a title="Yen" href="http://en.wikipedia.org/wiki/Yen">¥</a><br />
<em><strong>165</strong></em></td>
<td><a title="Pipe (computing)" href="http://en.wikipedia.org/wiki/Pipe_%28computing%29">¦</a><br />
<em><strong>166</strong></em></td>
<td><a title="Section sign" href="http://en.wikipedia.org/wiki/Section_sign">§</a><br />
<em><strong>167</strong></em></td>
<td><a title="Diaeresis" href="http://en.wikipedia.org/wiki/Diaeresis">¨</a><br />
<em><strong>168</strong></em></td>
<td><a title="Copyright symbol" href="http://en.wikipedia.org/wiki/Copyright_symbol">©</a><br />
<em><strong>169</strong></em></td>
<td><a title="ª" href="http://en.wikipedia.org/wiki/%C2%AA">ª</a><br />
<em><strong>170</strong></em></td>
<td><a title="Angle quotes" href="http://en.wikipedia.org/wiki/Angle_quotes">«</a><br />
<em><strong>171</strong></em></td>
<td><a title="Logical not" href="http://en.wikipedia.org/wiki/Logical_not">¬</a><br />
<em><strong>172</strong></em></td>
<td style="text-decoration:underline;"><a title="Soft hyphen" href="http://en.wikipedia.org/wiki/Soft_hyphen">SHY</a><br />
<em><strong>173</strong></em></td>
<td><a title="®" href="http://en.wikipedia.org/wiki/%C2%AE">®</a><br />
<em><strong>174</strong></em></td>
<td><a title="Macron" href="http://en.wikipedia.org/wiki/Macron">¯</a><br />
<em><strong>175</strong></em></td>
</tr>
<tr>
<th>Bx</th>
<td><a title="Degree (symbol)" href="http://en.wikipedia.org/wiki/Degree_%28symbol%29">°</a><br />
<em><strong>176</strong></em></td>
<td><a title="Plus-minus sign" href="http://en.wikipedia.org/wiki/Plus-minus_sign">±</a><br />
<em><strong>177</strong></em></td>
<td><a title="Square (algebra)" href="http://en.wikipedia.org/wiki/Square_%28algebra%29">²</a><br />
<em><strong>178</strong></em></td>
<td><a title="Cube (arithmetic)" href="http://en.wikipedia.org/wiki/Cube_%28arithmetic%29">³</a><br />
<em><strong>179</strong></em></td>
<td><a title="Acute accent" href="http://en.wikipedia.org/wiki/Acute_accent">´</a><br />
<em><strong>180</strong></em></td>
<td><a title="Mu (letter)" href="http://en.wikipedia.org/wiki/Mu_%28letter%29">µ</a><br />
<em><strong>181</strong></em></td>
<td><a title="Pilcrow" href="http://en.wikipedia.org/wiki/Pilcrow">¶</a><br />
<em><strong>182</strong></em></td>
<td><a title="Interpunct" href="http://en.wikipedia.org/wiki/Interpunct">·</a><br />
<em><strong>183</strong></em></td>
<td><a title="Cedilla" href="http://en.wikipedia.org/wiki/Cedilla">¸</a><br />
<em><strong>184</strong></em></td>
<td><a title="¹" href="http://en.wikipedia.org/wiki/%C2%B9">¹</a><br />
<em><strong>185</strong></em></td>
<td><a title="º" href="http://en.wikipedia.org/wiki/%C2%BA">º</a><br />
<em><strong>186</strong></em></td>
<td><a title="Angle quotes" href="http://en.wikipedia.org/wiki/Angle_quotes">»</a><br />
<em><strong>187</strong></em></td>
<td><a title="¼" href="http://en.wikipedia.org/wiki/%C2%BC">¼</a><br />
<em><strong>188</strong></em></td>
<td><a title="½" href="http://en.wikipedia.org/wiki/%C2%BD">½</a><br />
<em><strong>189</strong></em></td>
<td><a title="¾" href="http://en.wikipedia.org/wiki/%C2%BE">¾</a><br />
<em><strong>190</strong></em></td>
<td><a title="Question mark" href="http://en.wikipedia.org/wiki/Question_mark">¿</a><br />
<em><strong>191</strong></em></td>
</tr>
<tr>
<th>Cx</th>
<td><a title="À" href="http://en.wikipedia.org/wiki/%C3%80">À</a><br />
<em><strong>192</strong></em></td>
<td><a title="Á" href="http://en.wikipedia.org/wiki/%C3%81">Á</a><br />
<em><strong>193</strong></em></td>
<td><a title="Â" href="http://en.wikipedia.org/wiki/%C3%82">Â</a><br />
<em><strong>194</strong></em></td>
<td><a title="Ã" href="http://en.wikipedia.org/wiki/%C3%83">Ã</a><br />
<em><strong>195</strong></em></td>
<td><a title="Ä" href="http://en.wikipedia.org/wiki/%C3%84">Ä</a><br />
<em><strong>196</strong></em></td>
<td><a title="Å" href="http://en.wikipedia.org/wiki/%C3%85">Å</a><br />
<em><strong>197</strong></em></td>
<td><a title="Æ" href="http://en.wikipedia.org/wiki/%C3%86">Æ</a><br />
<em><strong>198</strong></em></td>
<td><a title="Cedilla" href="http://en.wikipedia.org/wiki/Cedilla">Ç</a><br />
<em><strong>199</strong></em></td>
<td><a title="È" href="http://en.wikipedia.org/wiki/%C3%88">È</a><br />
<em><strong>200</strong></em></td>
<td><a title="É" href="http://en.wikipedia.org/wiki/%C3%89">É</a><br />
<em><strong>201</strong></em></td>
<td><a title="Ê" href="http://en.wikipedia.org/wiki/%C3%8A">Ê</a><br />
<em><strong>202</strong></em></td>
<td><a title="Ë" href="http://en.wikipedia.org/wiki/%C3%8B">Ë</a><br />
<em><strong>203</strong></em></td>
<td><a title="Ì" href="http://en.wikipedia.org/wiki/%C3%8C">Ì</a><br />
<em><strong>204</strong></em></td>
<td><a title="Í" href="http://en.wikipedia.org/wiki/%C3%8D">Í</a><br />
<em><strong>205</strong></em></td>
<td><a title="Î" href="http://en.wikipedia.org/wiki/%C3%8E">Î</a><br />
<em><strong>206</strong></em></td>
<td><a title="Ï" href="http://en.wikipedia.org/wiki/%C3%8F">Ï</a><br />
<em><strong>207</strong></em></td>
</tr>
<tr>
<th>Dx</th>
<td><a title="Eth" href="http://en.wikipedia.org/wiki/Eth">Ð</a><br />
<em><strong>208</strong></em></td>
<td><a title="Ñ" href="http://en.wikipedia.org/wiki/%C3%91">Ñ</a><br />
<em><strong>209</strong></em></td>
<td><a title="Ò" href="http://en.wikipedia.org/wiki/%C3%92">Ò</a><br />
<em><strong>210</strong></em></td>
<td><a title="Ó" href="http://en.wikipedia.org/wiki/%C3%93">Ó</a><br />
<em><strong>211</strong></em></td>
<td><a title="Ô" href="http://en.wikipedia.org/wiki/%C3%94">Ô</a><br />
<em><strong>212</strong></em></td>
<td><a title="Õ" href="http://en.wikipedia.org/wiki/%C3%95">Õ</a><br />
<em><strong>213</strong></em></td>
<td><a title="Ö" href="http://en.wikipedia.org/wiki/%C3%96">Ö</a><br />
<em><strong>214</strong></em></td>
<td><a title="×" href="http://en.wikipedia.org/wiki/%C3%97">×</a><br />
<em><strong>215</strong></em></td>
<td><a title="Ø" href="http://en.wikipedia.org/wiki/%C3%98">Ø</a><br />
<em><strong>216</strong></em></td>
<td><a title="Ù" href="http://en.wikipedia.org/wiki/%C3%99">Ù</a><br />
<em><strong>217</strong></em></td>
<td><a title="Ú" href="http://en.wikipedia.org/wiki/%C3%9A">Ú</a><br />
<em><strong>218</strong></em></td>
<td><a title="Û" href="http://en.wikipedia.org/wiki/%C3%9B">Û</a><br />
<em><strong>219</strong></em></td>
<td><a title="Ü" href="http://en.wikipedia.org/wiki/%C3%9C">Ü</a><br />
<em><strong>220</strong></em></td>
<td><a title="Ý" href="http://en.wikipedia.org/wiki/%C3%9D">Ý</a><br />
<em><strong>221</strong></em></td>
<td><a title="Thorn (letter)" href="http://en.wikipedia.org/wiki/Thorn_%28letter%29">Þ</a><br />
<em><strong>222</strong></em></td>
<td><a title="ß" href="http://en.wikipedia.org/wiki/%C3%9F">ß</a><br />
<em><strong>223</strong></em></td>
</tr>
<tr>
<th>Ex</th>
<td><a title="À" href="http://en.wikipedia.org/wiki/%C3%80">à</a><br />
<em><strong>224</strong></em></td>
<td><a title="Á" href="http://en.wikipedia.org/wiki/%C3%81">á</a><br />
<em><strong>225</strong></em></td>
<td><a title="Â" href="http://en.wikipedia.org/wiki/%C3%82">â</a><br />
<em><strong>226</strong></em></td>
<td><a title="Ã" href="http://en.wikipedia.org/wiki/%C3%83">ã</a><br />
<em><strong>227</strong></em></td>
<td><a title="Ä" href="http://en.wikipedia.org/wiki/%C3%84">ä</a><br />
<em><strong>228</strong></em></td>
<td><a title="Å" href="http://en.wikipedia.org/wiki/%C3%85">å</a><br />
<em><strong>229</strong></em></td>
<td><a title="Æ" href="http://en.wikipedia.org/wiki/%C3%86">æ</a><br />
<em><strong>230</strong></em></td>
<td><a title="Ç" href="http://en.wikipedia.org/wiki/%C3%87">ç</a><br />
<em><strong>231</strong></em></td>
<td><a title="È" href="http://en.wikipedia.org/wiki/%C3%88">è</a><br />
<em><strong>232</strong></em></td>
<td><a title="É" href="http://en.wikipedia.org/wiki/%C3%89">é</a><br />
<em><strong>233</strong></em></td>
<td><a title="Ê" href="http://en.wikipedia.org/wiki/%C3%8A">ê</a><br />
<em><strong>234</strong></em></td>
<td><a title="Ë" href="http://en.wikipedia.org/wiki/%C3%8B">ë</a><br />
<em><strong>235</strong></em></td>
<td><a title="Ì" href="http://en.wikipedia.org/wiki/%C3%8C">ì</a><br />
<em><strong>236</strong></em></td>
<td><a title="Í" href="http://en.wikipedia.org/wiki/%C3%8D">í</a><br />
<em><strong>237</strong></em></td>
<td><a title="Î" href="http://en.wikipedia.org/wiki/%C3%8E">î</a><br />
<em><strong>238</strong></em></td>
<td><a title="Ï" href="http://en.wikipedia.org/wiki/%C3%8F">ï</a><br />
<em><strong>239</strong></em></td>
</tr>
<tr>
<th>Fx</th>
<td><a title="Eth" href="http://en.wikipedia.org/wiki/Eth">ð</a><br />
<em><strong>240</strong></em></td>
<td><a title="Ñ" href="http://en.wikipedia.org/wiki/%C3%91">ñ</a><br />
<em><strong>241</strong></em></td>
<td><a title="Ò" href="http://en.wikipedia.org/wiki/%C3%92">ò</a><br />
<em><strong>242</strong></em></td>
<td><a title="Ó" href="http://en.wikipedia.org/wiki/%C3%93">ó</a><br />
<em><strong>243</strong></em></td>
<td><a title="Ô" href="http://en.wikipedia.org/wiki/%C3%94">ô</a><br />
<em><strong>244</strong></em></td>
<td><a title="Õ" href="http://en.wikipedia.org/wiki/%C3%95">õ</a><br />
<em><strong>245</strong></em></td>
<td><a title="Ö" href="http://en.wikipedia.org/wiki/%C3%96">ö</a><br />
<em><strong>246</strong></em></td>
<td><a title="÷" href="http://en.wikipedia.org/wiki/%C3%B7">÷</a><br />
<em><strong>247</strong></em></td>
<td><a title="Ø" href="http://en.wikipedia.org/wiki/%C3%98">ø</a><br />
<em><strong>248</strong></em></td>
<td><a title="Ù" href="http://en.wikipedia.org/wiki/%C3%99">ù</a><br />
<em><strong>249</strong></em></td>
<td><a title="Ú" href="http://en.wikipedia.org/wiki/%C3%9A">ú</a><br />
<em><strong>250</strong></em></td>
<td><a title="Û" href="http://en.wikipedia.org/wiki/%C3%9B">û</a><br />
<em><strong>251</strong></em></td>
<td><a title="Ü" href="http://en.wikipedia.org/wiki/%C3%9C">ü</a><br />
<em><strong>252</strong></em></td>
<td><a title="Ý" href="http://en.wikipedia.org/wiki/%C3%9D">ý</a><br />
<em><strong>253</strong></em></td>
<td><a title="Thorn (letter)" href="http://en.wikipedia.org/wiki/Thorn_%28letter%29">þ</a><br />
<em><strong>254</strong></em></td>
<td><a title="Ÿ" href="http://en.wikipedia.org/wiki/%C5%B8">ÿ</a><br />
<em><strong>255</strong></em></td>
</tr>
</tbody>
</table>
<p>Tabela do CP1252 (<a title="CP1252" href="http://en.wikipedia.org/wiki/Windows-1252" target="_blank">ver original</a>)</p>
<p>Resumindo,  o valor de <strong><em>char c = &#8216;€&#8217;</em></strong> terá o valor de <strong>20</strong><span><strong>AChex </strong>no alfabeto do <strong>Unicode</strong>,  <strong>nenhum </strong>valor em ISO-8859-1 (o java nesta codificação representa-o por um ponto de interrogação ?), <strong>A4</strong>hex no alfabeto <strong>ISO-8859-15</strong> e <strong>80</strong>hex no alfabeto <strong>CP1252</strong> do windows.</span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ifthenelsecontinue.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ifthenelsecontinue.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ifthenelsecontinue.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ifthenelsecontinue.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ifthenelsecontinue.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ifthenelsecontinue.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ifthenelsecontinue.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ifthenelsecontinue.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ifthenelsecontinue.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ifthenelsecontinue.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ifthenelsecontinue.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ifthenelsecontinue.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ifthenelsecontinue.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ifthenelsecontinue.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ifthenelsecontinue.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ifthenelsecontinue.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ifthenelsecontinue.wordpress.com&amp;blog=1401746&amp;post=7&amp;subd=ifthenelsecontinue&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ifthenelsecontinue.wordpress.com/2007/12/10/o-simbolo-euro-e-os-encodings-de-java/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/79a16a851b2db78ef2fd415a38396d00?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lmen32</media:title>
		</media:content>

		<media:content url="http://htmlhelp.com/reference/charset/latin1.gif" medium="image">
			<media:title type="html">Alfabeto do ISO-8859-1</media:title>
		</media:content>
	</item>
		<item>
		<title>Introdução ao Java Mobile Edition</title>
		<link>http://ifthenelsecontinue.wordpress.com/2007/12/02/introducao-ao-java-mobile-edition/</link>
		<comments>http://ifthenelsecontinue.wordpress.com/2007/12/02/introducao-ao-java-mobile-edition/#comments</comments>
		<pubDate>Sun, 02 Dec 2007 19:50:08 +0000</pubDate>
		<dc:creator>lmen32</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://ifthenelsecontinue.wordpress.com/2007/12/02/introducao-ao-java-mobile-edition/</guid>
		<description><![CDATA[No site oficial da Sun para a plataforma Java encontra-se um artigo que detalha o que é a versão da plataforma Java para os dispositivos que não são PCs mas que tenham um processador mais simples e uma quantidade de memória mais pequena , por exemplo, telemóveis, receptores de TV cabo, frigoríficos, etc,. O slogan [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ifthenelsecontinue.wordpress.com&amp;blog=1401746&amp;post=6&amp;subd=ifthenelsecontinue&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>No site oficial da Sun para a plataforma Java encontra-se <a title="A survey of Java ME Today" href="http://developers.sun.com/mobility/getstart/articles/survey/" target="_blank">um artigo</a> que detalha o que é a versão da plataforma Java para os dispositivos que não são PCs mas que tenham um processador mais simples e uma quantidade de memória mais pequena , por exemplo, telemóveis, receptores de TV cabo, frigoríficos, etc,.</p>
<p>O slogan de lançamento da linguagem Java era &#8220;Write once, run everywhere&#8221;, ou seja, um programa em Java poderia correr em qualquer hardware porque existiria uma implementação da maquina virtual para a executar. Acontece que dentro do mundo dos Pcs esta premissa é relativamente fácil de obter, mesmo com a diferença de  tipos de processador e sistema operativo, porque o que caracteriza um PC/workstation/Servidor é a existência de uma placa gráfica, monitor, teclado query, rato, memória, BIOS, disco rígido e processador de pelo menos 32 bits. A distribuição Java Standard Edition, está pensada para executar neste ambiente de hardware.</p>
<p>Fora do mundo dos PCs o que está à volta do processador e da memória é definido pelo  fabricante do dispositivo, assim como as características do processador e a quantidade de memória: Um modelo de telefone pode ter uma certa quantidade de memória não encontrada noutro modelo, por exemplo e um electrodoméstico &#8220;Java&#8221; pode não ter um teclado query, mas apenas algumas teclas de controlo.</p>
<p>Estando identificado as dificuldades de caracterizar o hardware dos dispositivos a suportar como é que a SUN as solucionou? Ela categorizou o harware existente nos dispositivos e definiu para cada categoria quais as funcionalidades que a máquina virtual Java teria de suportar e quais as packages standards da linguagem Java a disponibilizar. As categorias básicas são:</p>
<p><strong>Connected Limited Device Configuration (CLDC):</strong> pensado para dispositivos com processadores de 16 e 32 bits, com uma ROM minima de 160 KB  e com uma RAM mínima de 32KB. A máquina virtual Java tem restrições relativamente à edição standard  implementando a especificação 1.4 da linguagem, sem ter entre outras coisas, finalizadores de classes e grupos de threads. Quanto às packages disponíveis elas são versões simplificadas de :</p>
<ul>
<li> java.lang</li>
<li>java.lang.ref</li>
<li>java.util</li>
<li>java.io</li>
</ul>
<p>e a inclusão da package javax.microedition.io especializada nas particularidades de input/o utput dos dispositivos.<br />
<strong>Connected Device Configuration (CDC): </strong>pensado para dispositivos mais potentes que os CLDCs, com processadores de 32bits, tendo pelo menos 2.5Mb de ROM e 2Mb de RAM. Acresce às funcionalidade do CLDC a inclusão de versões simplificadas de outras packages standards como:</p>
<ul>
<li>java.lang.reflect</li>
<li>java.math</li>
<li>java.text</li>
<li>java.util.zip</li>
<li>java.util.jar</li>
<li>java.net</li>
</ul>
<p>As configurações CLDC, CDC só definem o ambiente mínimo de execução num dispositivo. Com base nas suas características (existência de ecrân gráfico, de tem teclado, etc) estão definidas especificações que acrescentam packages não existentes na versão desktop da plataforma Java mas que estão adaptadas ao ambiente de execução dos dispositivos. A essas  especificações dão-se o nome de profiles e estão distribuidos pelas configurações do seguinte modo:</p>
<p>A configuração CLDC tem os profiles:</p>
<ul>
<li>Mobile Information Device Profile (<strong>MIDP</strong>), version 1.0 e 2.0</li>
<li>Information Module Profile (<strong>IMO</strong>) versão 1.0 e 2.0</li>
<li>Digital Set Top Box profile</li>
</ul>
<p>A configuração CDC tem os profiles:</p>
<ul>
<li>Foundation Profile</li>
<li>Personal Basis Profile</li>
<li>Personal Profile</li>
</ul>
<p>De todos estes profiles e configurações o mais comum é o CLDC/MIDP que é disponibilizado pela maior parte dos fabricantes de telemóveis.</p>
<p>O profile MIDP especifica as seguintes packages:</p>
<ul>
<li>javax.microedition.lcdui</li>
<li>javax.microedition.lcdui.game</li>
<li>javax.microedition.media</li>
<li>javax.microedition.media.control</li>
<li>javax.microedition.midlet</li>
<li>javax.microedition.pki</li>
<li>javax.microedition.rms (gravar e ler dados persistentes)</li>
</ul>
<p>Informação dos outros profiles e configurações encontra-se no artigo acima mencionado.</p>
<p>A questão é como programar uma aplicação para Mobile Edition. A primeira coisa é verificar quais as configurações e profiles suportadas pelo dispositivo. Esta verificação é estranha para o programador da Standard edition que só se tem de preocupar qual a versão da máquina virtual a suportar.</p>
<p>O ciclo de programação é um pouco mais complicado que o ambiente Desktop porque a fase de codificação e compilação é realizada num PC enquanto que a fase de teste/execução do programa é realizada no dispositivo após a sua transferência. Para acelerar a fase de testes/codificação é normalmente disponibilizado em conjunto com o compilador um emulador do dispositivo para que o programa possa ser executado no próprio PC.</p>
<p>Tomando um exemplo concreto vou tentar exemplificar como tornar o clássico &#8220;Olá benfica&#8221; numa aplicação mobile e executá-lo num telemóvel Nokia E60.</p>
<p>O telemóvel <a title="Especificações Nokia E60" href="http://developer.nokia.com/devices/E60" target="_blank">nókia E60</a> implementa as seguintes especificações Java Mobile Edition:</p>
<ul>
<li><strong>MIDP 2.0</strong></li>
<li><strong>CLDC 1.1</strong></li>
<li>JSR 120 Wireless Messaging API</li>
<li>JSR 135 Mobile Media API</li>
<li>JSR 172 Web Services API</li>
<li>JSR 177 Security and Trust Services API</li>
<li>JSR 179 Location API</li>
<li>JSR 180 SIP API</li>
<li>JSR 184 Mobile 3D Graphics API</li>
<li>JSR 185 JTWI</li>
<li>JSR 205 Wireless Messaging API</li>
<li>JSR 75 FileConnection and PIM API</li>
<li>JSR 82 Bluetooth API</li>
<li>Nokia UI API</li>
</ul>
<p>sendo constituído por um ecran de 356&#215;416 px, um processador  ARM 9 220Mhz, uma RAM de 64 mb. É mais potente que o Olivetti PC1!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ifthenelsecontinue.wordpress.com/6/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ifthenelsecontinue.wordpress.com/6/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ifthenelsecontinue.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ifthenelsecontinue.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ifthenelsecontinue.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ifthenelsecontinue.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ifthenelsecontinue.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ifthenelsecontinue.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ifthenelsecontinue.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ifthenelsecontinue.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ifthenelsecontinue.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ifthenelsecontinue.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ifthenelsecontinue.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ifthenelsecontinue.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ifthenelsecontinue.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ifthenelsecontinue.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ifthenelsecontinue.wordpress.com&amp;blog=1401746&amp;post=6&amp;subd=ifthenelsecontinue&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ifthenelsecontinue.wordpress.com/2007/12/02/introducao-ao-java-mobile-edition/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/79a16a851b2db78ef2fd415a38396d00?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lmen32</media:title>
		</media:content>
	</item>
	</channel>
</rss>
