| Autor |
Mensagem |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 07/07/2011 13:23:33
|
Metaleiro
Virtual Machine Man
![[Avatar]](/images/avatar/c2155acc6d5bcda7debfb19c3abef4af.jpg)
Membro desde: 06/07/2006 10:55:54
Mensagens: 671
Localização: São Bernardo do Campo - SP
Offline
|
Já tentei usar das seguintes formas :
Só que ambos estão me gerando a seguinte saída :
S?o Paulo
alguém poderia me ajudar ?
desde já agradeço !
This message was edited 2 times. Last update was at 07/07/2011 14:56:25
|
"Why, Mr. Anderson? Why do you do it? Why get up? Why keep fighting? Do you believe you're fighting for something? For more than your survival? Can you tell me what it is? Do you even know? Is it freedom? Or truth? Perhaps peace? Yes? No? Could it be for love? Illusions, Mr. Anderson. Vagaries of perception. The temporary constructs of a feeble human intellect trying desperately to justify an existence that is without meaning or purpose. And all of them as artificial as the Matrix itself, although only a human mind could invent something as insipid as love. You must be able to see it, Mr. Anderson. You must know it by now. You can?t win. It?s pointless to keep fighting. Why, Mr. Anderson? Why? Why do you persist?"
Neo :
-Because is my choice
|
|
|
 |
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 07/07/2011 13:29:30
|
JoaoBluSCBR
JavaEvangelist
![[Avatar]](/images/avatar/018f418df303f0090d6f81837408e107.png)
Membro desde: 18/11/2010 15:53:29
Mensagens: 474
Localização: Blumenau (SC)
Offline
|
E qual o formato do teu arquivo?
Faça a leitura e veja os valores dos caracteres especial, como estão saindo;
Daí fica mais fácil saber oque está acontecendo.
Dias atrás estava com esse problema, e estava usando o charset no readLine, não funcionava.
Coloquei no FileInput e beleza, talvez no teu caso tenha que colocar no readLine.
|
Venci !!! Acessei um webservice usando J2ME com ksoap e kxml. kkkkkk |
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 07/07/2011 13:38:22
|
Metaleiro
Virtual Machine Man
![[Avatar]](/images/avatar/c2155acc6d5bcda7debfb19c3abef4af.jpg)
Membro desde: 06/07/2006 10:55:54
Mensagens: 671
Localização: São Bernardo do Campo - SP
Offline
|
JoaoBluSCBR wrote:E qual o formato do teu arquivo?
Faça a leitura e veja os valores dos caracteres especial, como estão saindo;
Daí fica mais fácil saber oque está acontecendo.
Dias atrás estava com esse problema, e estava usando o charset no readLine, não funcionava.
Coloquei no FileInput e beleza, talvez no teu caso tenha que colocar no readLine.
Meu arquivo é um TXT no formato ASCII, como você fez o charset no fileInput, pode dar um exemplo ?
|
"Why, Mr. Anderson? Why do you do it? Why get up? Why keep fighting? Do you believe you're fighting for something? For more than your survival? Can you tell me what it is? Do you even know? Is it freedom? Or truth? Perhaps peace? Yes? No? Could it be for love? Illusions, Mr. Anderson. Vagaries of perception. The temporary constructs of a feeble human intellect trying desperately to justify an existence that is without meaning or purpose. And all of them as artificial as the Matrix itself, although only a human mind could invent something as insipid as love. You must be able to see it, Mr. Anderson. You must know it by now. You can?t win. It?s pointless to keep fighting. Why, Mr. Anderson? Why? Why do you persist?"
Neo :
-Because is my choice
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 07/07/2011 14:15:58
|
matheuslmota
Virtual Machine Man
Membro desde: 09/03/2010 15:14:56
Mensagens: 664
Offline
|
Supondo que exista a String "São Paulo" no seu arquivo, o seguinte código mostrou a string corretamente:
This message was edited 1 time. Last update was at 07/07/2011 14:16:24
|
Toda vez que você alimenta um troll uma foca morre no Polo Norte. |
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 07/07/2011 14:26:12
|
Metaleiro
Virtual Machine Man
![[Avatar]](/images/avatar/c2155acc6d5bcda7debfb19c3abef4af.jpg)
Membro desde: 06/07/2006 10:55:54
Mensagens: 671
Localização: São Bernardo do Campo - SP
Offline
|
matheuslmota wrote:Supondo que exista a String "São Paulo" no seu arquivo, o seguinte código mostrou a string corretamente:
Usou algum encoder ?
|
"Why, Mr. Anderson? Why do you do it? Why get up? Why keep fighting? Do you believe you're fighting for something? For more than your survival? Can you tell me what it is? Do you even know? Is it freedom? Or truth? Perhaps peace? Yes? No? Could it be for love? Illusions, Mr. Anderson. Vagaries of perception. The temporary constructs of a feeble human intellect trying desperately to justify an existence that is without meaning or purpose. And all of them as artificial as the Matrix itself, although only a human mind could invent something as insipid as love. You must be able to see it, Mr. Anderson. You must know it by now. You can?t win. It?s pointless to keep fighting. Why, Mr. Anderson? Why? Why do you persist?"
Neo :
-Because is my choice
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 07/07/2011 14:31:30
|
matheuslmota
Virtual Machine Man
Membro desde: 09/03/2010 15:14:56
Mensagens: 664
Offline
|
Usei não. Testou ai?
|
Toda vez que você alimenta um troll uma foca morre no Polo Norte. |
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 07/07/2011 14:52:14
|
matheuslmota
Virtual Machine Man
Membro desde: 09/03/2010 15:14:56
Mensagens: 664
Offline
|
O código que você passou inicialmente no post é o código correto para ler arquivos com encoding. Você tem certeza que o enconding é ASCII mesmo? A seguinte linha de código ler um arquivo de texto usando codifição ASCII. Veja se funciona:
|
Toda vez que você alimenta um troll uma foca morre no Polo Norte. |
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 07/07/2011 14:54:39
|
Metaleiro
Virtual Machine Man
![[Avatar]](/images/avatar/c2155acc6d5bcda7debfb19c3abef4af.jpg)
Membro desde: 06/07/2006 10:55:54
Mensagens: 671
Localização: São Bernardo do Campo - SP
Offline
|
matheuslmota wrote:Usei não. Testou ai?
Da forma que você postou provocou o seguinte resultado :
S?o Paulo
Mas dessa forma funcionou perfeitamente no formato .SQL ASCII
Obrigado !
|
"Why, Mr. Anderson? Why do you do it? Why get up? Why keep fighting? Do you believe you're fighting for something? For more than your survival? Can you tell me what it is? Do you even know? Is it freedom? Or truth? Perhaps peace? Yes? No? Could it be for love? Illusions, Mr. Anderson. Vagaries of perception. The temporary constructs of a feeble human intellect trying desperately to justify an existence that is without meaning or purpose. And all of them as artificial as the Matrix itself, although only a human mind could invent something as insipid as love. You must be able to see it, Mr. Anderson. You must know it by now. You can?t win. It?s pointless to keep fighting. Why, Mr. Anderson? Why? Why do you persist?"
Neo :
-Because is my choice
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 07/07/2011 14:57:14
|
matheuslmota
Virtual Machine Man
Membro desde: 09/03/2010 15:14:56
Mensagens: 664
Offline
|
Metaleiro wrote:
matheuslmota wrote:Usei não. Testou ai?
Da forma que você postou provocou o seguinte resultado :
S?o Paulo
Mas dessa forma funcionou perfeitamente no formato .SQL ASCII
Obrigado !
Tenta usar da forma que eu coloquei no meu último post par ver se funciona para ASCII puro.
|
Toda vez que você alimenta um troll uma foca morre no Polo Norte. |
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 07/07/2011 15:20:51
|
matheuslmota
Virtual Machine Man
Membro desde: 09/03/2010 15:14:56
Mensagens: 664
Offline
|
Cara, lembrei agora que o ASCII puro não aceita caracteres acentuados. Não iria conseguir ler nunca. Para ler caracteres acentuados você deve usar o encoding ISO-8859-1 (E seu arquivo deve ter sido gravado com tal).
Abs.
|
Toda vez que você alimenta um troll uma foca morre no Polo Norte. |
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 08/07/2011 08:42:02
|
Metaleiro
Virtual Machine Man
![[Avatar]](/images/avatar/c2155acc6d5bcda7debfb19c3abef4af.jpg)
Membro desde: 06/07/2006 10:55:54
Mensagens: 671
Localização: São Bernardo do Campo - SP
Offline
|
Obrigado pelas respostas, foram de grande ajuda !
|
"Why, Mr. Anderson? Why do you do it? Why get up? Why keep fighting? Do you believe you're fighting for something? For more than your survival? Can you tell me what it is? Do you even know? Is it freedom? Or truth? Perhaps peace? Yes? No? Could it be for love? Illusions, Mr. Anderson. Vagaries of perception. The temporary constructs of a feeble human intellect trying desperately to justify an existence that is without meaning or purpose. And all of them as artificial as the Matrix itself, although only a human mind could invent something as insipid as love. You must be able to see it, Mr. Anderson. You must know it by now. You can?t win. It?s pointless to keep fighting. Why, Mr. Anderson? Why? Why do you persist?"
Neo :
-Because is my choice
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 08/07/2011 08:46:33
|
matheuslmota
Virtual Machine Man
Membro desde: 09/03/2010 15:14:56
Mensagens: 664
Offline
|
Por nada, precisando, estamos ai!
This message was edited 2 times. Last update was at 08/07/2011 08:47:24
|
Toda vez que você alimenta um troll uma foca morre no Polo Norte. |
|
|
 |
|
|