Need to read Unicode in a file
Hi,
My need to read Unicode from a file (on a Windows box) is due to the fact my software is used in different countries and on different keyboard naturally. All the users are not computer literate but, like me, they are all lazy and want to put their username and password in a config file my application reads. If their username or password contain Unicode characters I have a problem reading.
They are simple users that I would like to advise them to open the config file using Windows Notepad, then type in their username and password, and save the file as Unicode. Notepad has four ways to save a file, ANSI, Unicode, Unicode big endian, and UTF-8 (I've tried them all except ANSI of course). Saving a file in a different format is as complicated as I would like it to get for them, some will have trouble even with this.
I read the file like so:
BufferedReader rdr =
new BufferedReader(
new InputStreamReader(new FileInputStream(file_name), "UTF-16"));
String line;
while ((line = rdr.readLine()) != null) {
String[] pieces = line.split("[=:]");
if (pieces.length == 2) {
if (pieces[0].equals("PASSWORD")) {
byte[] possibleUnicode = pieces[1].getBytes("various encodings");
pieces[1] = new String(possibleUnicode, "various encodings");
propertyTable.setProperty(pieces[0], pieces[1]);
}All reading is perfect except for a username or password which can contain a real multi-byte character. I have used many variations of converting the string I get into a byte[] using string_in.getBytes("various encodings tried") and then back to a string but nothing has worked.
I tried a regular FileReader to a BufferedReader and that didn't work. I tried a FileInputStreamto a DataInputStream and that didn't work. I accomplished the most with what I described above, FileInputStream to InputStreamReader to BufferedReader.
Does anyone know how to read Unicode in a file on a Windows file system?
hopi
I have used the byte conversion technique before
successfully when I loaded a set of properties
from a URL openStream(). The properties load()
method takes an InputStream and assumes ISO-8859-1
so I converted the bytes from ISO-8859-1 to UTF-8.
Garbage characters were cleared up perfectly.I think you just got lucky that time. For characters up to U+007F, the UTF-8 encoding is the same as ISO-8859-1 (and most other encodings, for that matter). Characters in the range U+0080 to U+00FF will be encoded with one byte in ISO-8859-1, and with two bytes in UTF-8. In most cases, each of the two bytes in the UTF-8 representation will have values that are valid in ISO-8859-1. The decoded characters will be incorrect (and there will be too many of them), but they effectively preserve the original byte values, making it possible for you to re-encode the characters and then decode them correctly. But there's a big gap in the middle where the UTF-8 bytes produce garbage when decoded as IS)-8859-1. Run the included program to see what I mean.
I don't know what's going wrong with your application, but I do know that changing the encoding retroactively is not the solution. I also think you're right about asking users save files in a certain encoding. Considering how much trouble programmers have with this stuff, it's definitely too much to ask of users.
import java.awt.Font;
import javax.swing.*;
public class Test
public static void main(String... args) throws Exception
JTextArea ta = new JTextArea();
ta.setFont(new Font("monospaced", Font.PLAIN, 14));
JFrame frame = new JFrame();
frame.add(new JScrollPane(ta));
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
StringBuilder sb = new StringBuilder();
for (int i = 0xA0; i <= 0xFF; i++)
sb.append((char)i);
String str1 = sb.toString();
byte[] utfBytes = str1.getBytes("UTF-8");
String str2 = new String(utfBytes, "ISO-8859-1");
for (int i = 0, j = 0; i < str1.length(); i++, j += 2)
char ch = str1.charAt(i);
byte b1 = utfBytes[j];
byte b2 = utfBytes[j+1];
String s1 = Integer.toBinaryString(b1 & 0xFF);
String s2 = Integer.toBinaryString(b2 & 0xFF);
char ch1 = str2.charAt(j);
char ch2 = str2.charAt(j+1);
ta.append(String.format("%2c%10s%10s%3x%3x%3c%3c\n",
ch, s1, s2, b1, b2, ch1, ch2));
frame.setSize(400, 700);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
Similar Messages
-
Help needed regarding reading in a text file and tokenizing strings.
Hello, I require help with a task I've been set, which asks me to read in a text file, and check the contents for errors. The text file contains lines as follows.
surname:forename:1234:01-02-06
I can read in the file, but dont know how to split the strings so each token can be tested (ie numbers in the name tokens)
However, I am not allowed to use regex functions, only those found in java.io.*
I think i should be putting the tokens into an array, but have had no luck so far in doing so. Any help would be appreciated.public class Validator {
public static void main(String args[]) {
String string = "Suname:Forename:1234:01_02-06";
String stringArray[] = string.split(":");
System.out.println (validateLetters(stringArray[0]));//returns true
System.out.println (validateNumbers(stringArray[3]));//returns false
static boolean validateLetters(String s) {
for(int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if ((c < 'A' || c > 'Z') && (c < 'a' || c > 'z')) {
return false; //return false if one of characters is other than a-z A-Z
}//end if
}//end for
return true;
}//end validateLetters
static boolean validateNumbers(String s) {
for(int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if ((c < '0' || c > '9') && (c != '-')) {
return false; //return false if one of characters is other than 0-9 or -
}//end if
}//end for
return true;
}//end validateNumbers
} -
How to read a whole text file into a pl/sql variable?
Hi, I need to read an entire text file--which actually contains an email message extracted from a content management system-- into a variable in a pl/sql package, so I can insert some information from the database and then send the email. I want to read the whole text file in one shot, not just one line at a time. Shoud I use Utl_File.Get_Raw or is there another more appropriate way to do this?
how to read a whole text file into a pl/sql variable?
your_clob_variable := dbms_xslprocessor.read2clob('YOUR_DIRECTORY','YOUR_FILE');
.... -
Getting repeated values when reading from a text file.
I need to read from a text file. When the token encounters a particular word (command) I need to read the next line and perform some actions. However, this part is working but it is repeating the values again and again until it encounters the next particular word (command). Hope that someone will help me out, as always when I posted a problem in these forums.
SetOperations class - contains the set methods
// Imported packages.========================================================
import java.util.Vector;
import java.util.Iterator;
// Public class SetOperations.===============================================
public class SetOperations
// Instance variables.===================================================
private Vector v = null; // Creates new instance of vector.
protected int memberCount;
// Constructor.==========================================================
public SetOperations()
v = new Vector();
} // end constructor.
// Method isMember.======================================================
* Checks whether the element is already a member of the set.
* @return True if Vector v contains Object member.
public boolean isMember(Object member)
if (member != null) // only if Object member is not null.
return v.contains(member); // returns true if vector already contains member.
else
return false; // returns false if vector does not contain member.
} // end public boolean isMember(Object member).
// Method addMember.=====================================================
* Adds a member to the set.
* @return Adds Object member to Vector v.
public void addMember(Object member)
//if (! v.contains(member)) // only if element is not already a member.
if (isMember(member) == false) // only if element is not already a member.
v.add(member); // adds a member.
} // end public void addMember(Object member).
// Method countMember.===================================================
* Returns the number of members present in the vector.
* @return Number of elements present in the vector.
public int countMember()
return v.size();
} // end public int countMember().
// Method isSetEmpty.====================================================
* Returns true if set is empty.
* @return True if no elements are present in Vector v.
public boolean isSetEmpty()
return v.size() == 0; // returns 0 if no elements are present in the vector.
} // end of public boolean isSetEmpty().
// Method printMember.===================================================
* Displays member/s of the set.
* @return Prints element/s present in the vector.
public void printMember()
for (int i = 0; i < v.size(); i++) // iterates through present members.
System.out.println("[" + i + "] " + v.get(i)); // displays member/s present in the vector.
} // end of public void printMember().
} // end public class SetOperations.
SetTextLauncher class - reads from a text file and implements the set operations
// Imported packages.========================================================
import java.util.*;
import java.io.*;
// Public class SetTestLauncher.=============================================
public class SetTestLauncher
// Main method public static void main(String args[]).===================
public static void main(String args[])
displayFile("test.txt"); // outputs result from text file.
// method to display a file on screen
public static void displayFile (String textFile)
// Instance variables.===============================================
// Creates new instances of SetOperations.
SetOperations setA = new SetOperations();
SetOperations setB = new SetOperations();
SetOperations setC = new SetOperations();
SetOperations setD = new SetOperations();
SetOperations setE = new SetOperations();
// Initialisation.
String line = "", nextLine = "";
FileReader fr = null;
try
// Opens the file with the FileReader data sink stream.
fr = new FileReader(textFile);
// Converts the FileReader input stream with the BufferedReader processing stream.
BufferedReader br = new BufferedReader(fr);
// Iterates through text file reading lines until end of text lines.
while (line != null)
line = br.readLine(); // reads one line at a time.
if(line == null) break; // when the line is null break the loop.
// Creates a new instace of StringTokenizer.
StringTokenizer st = new StringTokenizer(line);
// Loops until there are no more tokens.
while (st.hasMoreTokens())
String token = st.nextToken(); // reads next token.
// Only if the token encounters the String "membera".
if(token.equals("membera"))
nextLine = br.readLine(); // gets next line.
setA.addMember(nextLine); // adds a member to the set.
// Displays members present in the set if vector is not empty.
if (! setA.isSetEmpty())
setA.printMember(); // print members present.
// Displays the number of member/s present in the vector.
System.out.println("Number of set members: " + setA.countMember());
// Catches and displays exceptions.
catch (FileNotFoundException exp)
System.out.println(exp.getMessage());
exp.printStackTrace();
catch (IOException exp)
System.out.println(exp.getMessage());
exp.printStackTrace();
finally
try
// if file is found
if (fr != null)
// close file
fr.close();
catch (IOException exp)
exp.printStackTrace();
} // end public static void main(String args[]).
} // end public class SetTestLauncher.Thanks for your interest. Please ignore SetOperations class, it is just the class containing the methods and it works correctly since I checked it without reading from a text file. I marked the part where I think lies my problem in class SetTestOperations.
The information in the text file is as follows:
membera
Hillman
membera
Skoda
membera
Honda
membera
Toyota
and the result is:
[0] Hillman
Number of set members: 1
[0] Hillman
[1] Skoda
Number of set members: 2
[0] Hillman
[1] Skoda
[2] Honda
Number of set members: 3
[0] Hillman
[1] Skoda
[2] Honda
[3] Toyota
Number of set members: 4
instead of just one set:
[0] Hillman
[1] Skoda
[2] Honda
[3] Toyota
Number of set members: 4
Hope it is easier to understand like this.
Regards
Marco
I need to read from a text file. When the token
encounters a particular word (command) I need to read
the next line and perform some actions. However, this
part is working but it is repeating the values again
and again until it encounters the next particular
word (command). Hope that someone will help me out,
as always when I posted a problem in these forums.
SetOperations class - contains the set
methods
// Imported
packages.=============================================
===========
import java.util.Vector;
import java.util.Iterator;
// Public class
SetOperations.========================================
=======
public class SetOperations
// Instance
e
variables.============================================
=======
private Vector v = null; // Creates new instance of
f vector.
protected int memberCount;
Constructor.==========================================
================
public SetOperations()
v = new Vector();
} // end constructor.
// Method
d
isMember.=============================================
=========
* Checks whether the element is already a member of
f the set.
* @return True if Vector v contains Object member.
public boolean isMember(Object member)
if (member != null) // only if Object member is not
ot null.
return v.contains(member); // returns true if
if vector already contains member.
else
return false; // returns false if vector does not
not contain member.
} // end public boolean isMember(Object member).
// Method
d
addMember.============================================
=========
* Adds a member to the set.
* @return Adds Object member to Vector v.
public void addMember(Object member)
//if (! v.contains(member)) // only if element is
is not already a member.
if (isMember(member) == false) // only if element
nt is not already a member.
v.add(member); // adds a member.
} // end public void addMember(Object member).
// Method
d
countMember.==========================================
=========
* Returns the number of members present in the
e vector.
* @return Number of elements present in the vector.
public int countMember()
return v.size();
} // end public int countMember().
// Method
d
isSetEmpty.===========================================
=========
* Returns true if set is empty.
* @return True if no elements are present in Vector
r v.
public boolean isSetEmpty()
return v.size() == 0; // returns 0 if no elements
ts are present in the vector.
} // end of public boolean isSetEmpty().
// Method
d
printMember.==========================================
=========
* Displays member/s of the set.
* @return Prints element/s present in the vector.
public void printMember()
for (int i = 0; i < v.size(); i++) // iterates
es through present members.
System.out.println("[" + i + "] " + v.get(i)); //
// displays member/s present in the vector.
} // end of public void printMember().
} // end public class SetOperations.
SetTextLauncher class - reads from a text file
and implements the set operations
// Imported
packages.=============================================
===========
import java.util.*;
import java.io.*;
// Public class
SetTestLauncher.======================================
=======
public class SetTestLauncher
// Main method public static void main(String
g args[]).===================
public static void main(String args[])
displayFile("test.txt"); // outputs result from
om text file.
// method to display a file on screen
public static void displayFile (String textFile)
// Instance
ce
variables.============================================
===
// Creates new instances of SetOperations.
SetOperations setA = new SetOperations();
// Initialisation.
String line = "", nextLine = "";
FileReader fr = null;
try
// Opens the file with the FileReader data sink
ink stream.
fr = new FileReader(textFile);
// Converts the FileReader input stream with the
the BufferedReader processing stream.
BufferedReader br = new BufferedReader(fr);
// Iterates through text file reading lines until
til end of text lines.
while (line != null)
line = br.readLine(); // reads one line at a
at a time.
if(line == null) break; // when the line is null
null break the loop.
// Creates a new instace of StringTokenizer.
StringTokenizer st = new StringTokenizer(line);
// Loops until there are no more tokens.
while (st.hasMoreTokens())
String token = st.nextToken(); // reads next
next token.
// Only if the token encounters the String
tring "membera".
if(token.equals("membera"))
// *****THE PROBLEM LIES HERE....I GUESS
// need to read the next line after encountering the word membera in text file
nextLine = br.readLine(); // gets next line.
setA.addMember(nextLine); // adds a member to
ber to the set.
// Displays members present in the set if
set if vector is not empty.
if (! setA.isSetEmpty())
setA.printMember(); // print members present.
// Displays the number of member/s present in
ent in the vector.
System.out.println("Number of set members: " +
s: " + setA.countMember());
// Catches and displays exceptions.
catch (FileNotFoundException exp)
System.out.println(exp.getMessage());
exp.printStackTrace();
catch (IOException exp)
System.out.println(exp.getMessage());
exp.printStackTrace();
finally
try
// if file is found
if (fr != null)
// close file
fr.close();
catch (IOException exp)
exp.printStackTrace();
} // end public static void main(String args[]).
} // end public class SetTestLauncher. -
Read in a text file and parse at spaces
I need to read in a text file, then split it at the spaces (after each word)
then I would like to save each sentence (maybe as a String Buffer)
(chek each word to see if a .?! is at the end to determine the end of a sentence)
Then I need to add the word END to the end of the StringBuffer
then store each sentence as an element in an arrayList.
Please Help.Cant you just store the entire text file into a really big String, then split it at each "."?
String text = "";
//read file into text
String[] sentences = text.split("."); -
Help with reading in a text file and arrays
I need to read in a text file with info like this for example
dave
martha
dave
billy
I can read the information into an array and display the names but what I need to do is display how many times the same name is in the file for example the output should be
dave 2
martha 1
billy 1
How can I accomplish this? Would I use a Compareto Method to find
duplicate names?Hi,
I would recommend storing them in a Hashtable.. something like this:
Hashtable names = new Hashtable() ;
String s ;
while( ( s = bufferedReader.readLine() ) != null ) {
if ( names.contains( s ) ) {
names.put( s , new Integer( names.get(s)+1 ) ) ;
else {
names.put( s , new Integer( 1 ) ) ;
}Then the hashtable will contain a set of keys and values, which are the names and counts respectively.
Kenny -
Read and List the Files from Remote Webserver Path
Hi All,
I have requirement where i need to Read and List the files from a Folder of Remote webserver path using JAVA.
Remote webserver is within the network only...No Firewall and also Access is given to Read the folder. No Issues on this.
Folder will just contain some PDF files...
I just need to display the PDF file names available in the Folder..
No need to read the PDF File...Only required to read the folder to list the file names in it.
Looking forward some workaround to this.
Thanks and Regards.I need to read the folder from a webserver path of different machine...
File dir = new File( prop.getProperty("inputPath"));
File[] files = dir.listFiles(fileFilter);
final String match=siteName;
final String type=reportType;
Calendar c1 = Calendar.getInstance();
c1.add(Calendar.MONTH, - Integer.parseInt(prop.getProperty("filterMonths"))); //Filters reportes generated in last X months (X picked from config file)
final long filterDate = c1.getTime().getTime();
FileFilter fileFilter = new FileFilter() {
public boolean accept(File file) {
long fileLastModiDate = file.lastModified();
if((fileLastModiDate >= filterDate) && (file.getName().toLowerCase().startsWith(match)) && ( (type.equals("M") && file.getName().indexOf("WIP")==-1) || ((!type.equals("M") && file.getName().indexOf("WIP")!=-1)) ) ) {
return true;
}else {
return false;
Here it works fine if the input path is local machine..
But i need to know how to give the input path as WEBSERVER PATH of different machine?? -
Read lines from text file to java prog
how can I read lines from input file to java prog ?
I need to read from input text file, line after line
10x !If you search in THIS forum with e.g. read lines from file, you will find answers like this one:
Hi ! This is the answer for your query. This program prints as the output itself reading line by line.......
import java.io.*;
public class readfromfile
public static void main(String a[])
if you search in THIS forum, with e.g. read lines from text file
try{
BufferedReader br = new BufferedReader(new FileReader(new File("readfromfile.java")));
while(br.readLine() != null)
System.out.println(" line read :"+br.readLine());
}catch(Exception e)
e.printStackTrace();
} -
Reading Unicode data from a file...
I am writing an application that needs to read some configuration data from a file. An end user edits the configuration file to provide the configuration data. The Java code reads this file and uses the configuration data supplied by the user.
The user can also save non-ascii characters as part of the configuration data. hence, I do not want to use java properties files. What are the other options available that allow me reading Unicode data into my Java code and will also allow user to save the configuration file as Unicode?Java characters are Unicode characters. Read file data that consists of Unicode characters as Java characters or strings.
You can read the data as primitive char values using the DataInputStream class. The InputStreamReader class can also read Unicode (UTF-16) data.
Data can be written using the OutputStreamWriter class. -
Read Unicode text file convert to ANSI text file
I am new to Java. I am trying to read from, ReadUnicodeEncodedPlainTextDocument.txt, a plain text file encoded
in Unicode, then select four particular lines, and then write those plain text lines to, WriteANSIencodedPlainTextSelectedFields.txt,
another file encoded in ANSI.
Using my code ConvertEncodedText.java:
import java.io.*;
import java.util.Scanner;
public class ConvertEncodedText
public static void main(String[] args) throws Exception
File f = new File("ReadUnicodeEncodedPlainTextDocument.txt");
Scanner scan = new Scanner(f);
String peek1, peek2, peek3, peek4;
boolean pk1 = false, pk2 = false, pk3 = false;
int count = 0;
while(scan.hasNext()) // begin search
peek1 = scan.nextLine();
if (peek1.startsWith("From"))
pk1 = true;
peek2 = scan.nextLine();
if(pk1 && peek2.startsWith("Date"))
pk2 =true;
peek3 = scan.nextLine();
if(pk1 && pk2 && peek3.startsWith("To"))
pk3 = true;
peek4 = scan.nextLine();
if(pk1 && pk2 && pk3 && peek4.startsWith("Subject"))
System.out.println("\n" + peek1 + "\n" + peek2 + "\n" + peek3 + "\n" + peek4);
count++;
pk1 = false;
pk2 = false;
pk3 = false;
}//if pk1 && pk2 && pk3 && peek4.startsWith("Subject")), print, begin new search
else
pk1 = false;
pk2 = false;
pk3 = false;
}//else begin new search
}//if(pk1 && pk2 && peek3.startsWith("To"))
else
pk1 = false;
pk2 = false;
pk3 = false;
}//else begin new search
}//if(pk1 && peek2.startsWith("Date"))
else
pk1 = false;
pk2 = false;
pk3 = false;
}//else begin new search
}//if (peek1.startsWith("From"))
}//while hasNext
System.out.println("\ncount = " + count);
}As shown below, I would like to write to the following text file encoded in ANSI, WriteANSIencodedPlainTextSelectedFields.txt:
From: "Mark E Smith" <[email protected]>
Date: April 9, 2007 11:28:19 AM PST
To: <[email protected]>
Subject: FW: RFI Research Topic Up-date
From: "Mark E Smith" <[email protected]>
Date: May 26, 2007 11:14:12 AM PST
To: <[email protected]>
Subject: Batting Practice Sportsphere
From: "Mark E Smith" <[email protected]>
Date: May 30, 2007 11:53:45 PM PST
To: <[email protected]>
Subject: 3p meeting
From: "Mark E Smith" <[email protected]>
Date: June 20, 2007 4:09:10 PM PST
To: <[email protected]>
Subject: Question
count = 4
In order to produce the above text file,
I would like to read the following text file encoded in Unicode, ReadUnicodeEncodedPlainTextDocument.txt:
From: "Mark E Smith" <[email protected]>
Date: April 9, 2007 11:28:19 AM PST
To: <[email protected]>
Subject: FW: RFI Research Topic Up-date
Hi, Dr. Ulrich.? Are there any authors and titles of JME that you could recommend for my reading??
Thanks.? Mark
From: Joe Greene [mailto:[email protected]]
Sent: Sat 4/7/2007 4:10 PM
To: Mark E Smith
Subject: RE: RFI Research Topic Up-date
Hi Mark,
Thanks for the update. I have met Dr. Ulrich on several occasions ? he is a great guy!
Dr. Hammer and I also have the same advisor from graduate school. He did his Masters with my PhD advisor at Poly-Tech. We have also met many times in the past. I think you will be in good hands down there.
It seems clear that you need to start learning JME and can perhaps forget about Windows Mobile. JME represents a smaller footprint for Java that contains support for various APIs for mobile functionality. I do not own any JME books, but a search on Amazon.com turned up what looks like several good ones.
Best wishes
Joe
----------------------------------------------------
Joe Greene, Ph.D.
DCSIT
it.sdu.com
[email protected]
http://www.greene.org
From: Mark E Smith [mailto:[email protected]] 
Sent: Saturday, April 07, 2007 9:30 AM
To: [email protected]
Subject: RFI Research Topic Up-date
Welcome to the conversation, Dr.Greene.? This is where we are so far.? I would appreciate your thoughts.
Thanks.? Mark
From: "Mark E Smith" <[email protected]>
Date: May 26, 2007 11:14:12 AM PST
To: <>
Subject: Batting Practice Sportsphere
Saturday, May 26, 2007
Hi, Dr. Ulrich.? This read-sensitive run-recognition pitching distribution is perhaps a commercial problem in a less sophisticated framework.? Could we build a simple commercial application and then customize the solution for the Ballpark functions and framework?? Thanks.? Mark
From: "Mark E Smith" <[email protected]>
Date: May 30, 2007 11:53:45 PM PST
To: <[email protected]>
Subject: 3p meeting
Hi, Dr. Ulrich.? Attached are a few notes from my research of the project docs that you sent me.? I am looking forward to our 3p meeting.??Thanks.? Mark?
From: "Mark E Smith" <[email protected]>
Date: June 20, 2007 4:09:10 PM PST
To: <[email protected]>
Subject: Question
Hi, Dr. Ulrich.? Pine-tar.? What do you think?? Would you please show me how to pitch sliders and splitters into this so I can study the features in detail?? Thanks.? Mark
P.S.
As you can see, my code reads the particular sequence of 4 selected fields, From, Date, To, and Subject,
out of an email that contains that specific sequence of 4 fields then I would like to place them in a text file
called WriteANSIencodedPlainTextSelectedFields.txt, and then print the number of emails in the document.
Instead of the desired output I would like to write to the file WriteANSIencodedPlainTextSelectedFields.txt; I am only getting this:
Count = 0
What is my problem???
Thanks,
MikeWhat is my problem???Obviously one of your conditions not being true...
What does your question have to do with the thread's subject, btw? -
Reading unicode file using pure C++??
Hi Guys,
I need help reading a unicode/utf8 file using C/C++. Any pointers or sample code will be of great help.
Thanks
GulshanSee sections 20.2 and 20.3 of "The C++ Programming Language" 3rd ed. - by Bjarne Stroutrup.
I'll go out on a limb and naively state that using wstring rather than string will take you a long way towards solving your problem, but you might have to play around with char_traits. The general usage of wstring should be identical to string, so I'm sure you can find many examples.
... Dave -
Hi all,
I'm fairly new to java. In my program i need to read a Unicode file. (When i did it normal way it shows only "?" s for all the non English characters).
can any one help me? (It better u can sent a simple example too)
Thanks.
regards,
wijithaUse an InputStreamReader.
-
Unable to properly read a binary .xls file in a unicode system.
Hello,
We are currently upgrading to ecc 6 unicode
from a non unicode ecc5 system and we have
found several problems reading files for
Excel in place (sap office intergration).
We have an excel file with macros scripted
within it and it, parts of the file are in
hebrew.
We use open dataset for input command to
provide the data to the sap integration
methods.
In ecc5, no additional parameters were
needed for the command.
In the unicode system, the file isn't read
properly even when providing codepage for
the file in legacy binary mode (I tried '1800' and '1810' for hebrew).
When compared to a non unicode system, it seems
that some of the binary data is missing and some
characters are missing and instead appear
like squares.
this leads to the file not being read at
all.
Is there any method to read the file with
the characters in it properly , or force it
to use the non unicode read method?
Best regards, YoavTry the Acrobat forum; this is the Adobe Reader forum.
-
hey ppl
i have a datagrid in my form.i need to read input(fields..sort of a database) from a text file and display its contents in the datagrid.
how can this be done.. and also after every few seconds reading event should be re executed.. and that the contents of the datagrid will keep changing as per the changes in the file...
please help as this is urgent and important.. if possible please provide me with an example code as i am completely new to flex...
thanks.....It's not possible to read from a file without using classes from the core API*. You'll have to get clarification from your instructor as to which classes are and are not allowed.
[http://java.sun.com/docs/books/tutorial/essential/io/]
*Unless you write a bunch of JNI code to replicate what the java.io classes are doing. -
Need to read data from a text file
I need to read data from a text file and create my own hash table out of it. I'm not allowed to use the built in Java class, so how would I go implementing my own reading method and hash table class?
It's not possible to read from a file without using classes from the core API*. You'll have to get clarification from your instructor as to which classes are and are not allowed.
[http://java.sun.com/docs/books/tutorial/essential/io/]
*Unless you write a bunch of JNI code to replicate what the java.io classes are doing.
Maybe you are looking for
-
Help with Yosemite? So distressing....
So just yesterday I decided to update my software so I could install an app.. hardly worth it now. I went from using Snow Leopard (I have a Macbook - 2008) to now downloading Yosemite and I am absolutely annoyed.. I don't know why I ever did this. My
-
IPod Touch no longer working with Nike after 4.3.2 update.
I updated to 4.3.2 about a week ago and immediately afterwards my itouch was not able to pick up the Nike+ sensor when initiating a run (during the "walk around to start the sensor" part). I even went out and dropped 20 bucks on a new sensor at Best
-
Reading Individual Lines of Text Into An ArrayList or Vector From A File
I am trying to read each individual line of text of a .txt file into an ArrayList or Vector. I seem to get the same results no matter which Object I am using (ArrayList or Vector). The text file is a comma-delimited text file to be used as a database
-
Boolean Fields as JCheckbox in a Dynamic JTable
Hi, I am building an application like an sql query browser. I want to show boolean fields as JCheckbox in JTable. But the problem is that the table is dynamic, i don't know which column is boolean. How can i handle this? Should i configure getValueAt
-
Lost photos problem with iphoto 2
i seem to have lost around 90% of my photos - at least - they are not in the library when i start iphoto - but they are there when i check finder. roll 10 to roll 82 are missing. i just imported more photos - and iphoto seemed to work out that they m