-
Unable to display special characters in Java
I wrote a program that traverses a directory for files of a given extension and then displays the absolutePath in a JList. Double-clicking on a filename will open it in the registered program. It works perfectly for English filenames. The problem is when I have other characters in the filename. For example, if I have a file titled "Mexico.txt" with an accented e, it shows up in the list with a block in place of the e. So the first problem is not being able to properly display the special characters. Next, if I double-click that file it sees the absolutePath as "m%3Fxico.txt" which I'm guessing is some sort of unicode encoding. Unfortunately, that encoding is not handled properly by the Runtime.getRuntime() method. I get a "file does not exist" error. All features work fine with English characters.
I have tried the JRE that comes with Knoppix 5.1.1 as well as fresh installs of JRE5 and JRE6 with the same results. In Windows Vista the accented characters appear properly when using JRE5 and JRE6.
Any help with these issues is greatly appreciated.
Similar Threads
-
By Albretch in forum General Support
Replies: 1
Last Post: 07-07-2007, 10:45 PM
-
By lovetide in forum General Support
Replies: 0
Last Post: 06-07-2006, 05:23 PM
-
By lutzweber in forum Tips and Tricks
Replies: 0
Last Post: 03-25-2005, 10:45 PM
-
By ZX in forum General Support
Replies: 0
Last Post: 03-15-2004, 08:34 AM
-
By phoneutria in forum General Support
Replies: 0
Last Post: 08-21-2003, 08:58 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules

AMD Ryzen 5 5500 Processor ( read Description)
$59.00

Intel Core i7-4770 3.40GHz Quad Core SR149 LGA 1150 CPU Processor tested
$35.00

INTEL CORE I9-10940X X-SERIES PROCESSOR | 3.30GHZ | SRGSH
$179.99

Intel Core i7-10700 8-Core 16-Thread 2.9GHz Desktop CPU LGA1200 SRH6Y Z490 Z590
$129.00

Intel Core i7-3770K 3.5 GHz Processor
$39.00

Intel Core i7-9700 Octa-Core 3 GHz Desktop Processor LGA 1151
$79.99

Intel Core i5-12500T SRL5W 2GHz 18MB 6 Core Socket LGA1700 Desktop CPU Processor
$114.99

Intel i7-8700 Coffee Lake 3.2GHz 6-Core Max Turbo 4.6GHz Processor
$67.99

Lenovo ThinkCentre M920s SFF Barebones PC Motherboard PSU DVD No CPU RAM SSD
$27.99

INTEL CORE I9-10980XE PROCESSOR | 3.00GHZ | SRGSG
$299.99