473,503 Members | 12,383 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Text File encoding?

I have a file that was generated on a customers computer which is not
using the Windows default text encoding but uses Japanese(Shift-JIS)
encoding.

If I open the file in notepad the data looks normal but my application
can not read in the data properly (Line breaks are not what is expected)

Is there a way to translate a file to the windows default text encoding?

Also, is there an API to determine the which encoding a system is using?

Thanks,

Jamie
Jul 17 '05 #1
2 6847
What do you mean by "line breaks are not what is expected"? Do you mean the
ASCII/ANSI character codes for a linefeed/newline are not vbCrLf (chr$(13) &
chr$(10))?

--

Randy Birch
MVP Visual Basic
http://vbnet.mvps.org/
Please respond only to the newsgroups so all can benefit.
"jamie" <ja***@noway.com> wrote in message
news:rB********************@news20.bellglobal.com. ..
:I have a file that was generated on a customers computer which is not
: using the Windows default text encoding but uses Japanese(Shift-JIS)
: encoding.
:
: If I open the file in notepad the data looks normal but my application
: can not read in the data properly (Line breaks are not what is expected)
:
: Is there a way to translate a file to the windows default text encoding?
:
: Also, is there an API to determine the which encoding a system is using?
:
: Thanks,
:
: Jamie

Jul 17 '05 #2
Randy Birch wrote:
What do you mean by "line breaks are not what is expected"? Do you mean the
ASCII/ANSI character codes for a linefeed/newline are not vbCrLf (chr$(13) &
chr$(10))?


No I mean that the line breaks are not added in the correct locations
(if converting the encoding with word)... for example it adds 3
linebreaks to the end of the document and splits up a couple of lines
where there are spaces between the data.

Jamie
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
8980
by: David Thomas | last post by:
Hi there, a while ago, I posted a question regarding reading japanese text from a text file. Well, since I solved the problem, I thought I'd post my solution for the benefit of other people with...
3
5857
by: xmlguy | last post by:
XmlTextReader myXmlReader = new XmlTextReader(args); string en = myXmlReader.Encoding.EncodingName; //Console.WriteLine(x); Error: Unhandled Exception: System.NullReferenceException: Object...
4
11488
by: H Lee | last post by:
Hi, I'm an XML newbie, and not sure if this is the appropriate newsgroup to post my question, so feel free to suggest other newgroups where I should post this message if this is the case. I'm...
13
6082
by: Dan V. | last post by:
How do I create a one line text file with these control codes? e.g.: 144 = 0x90 and 147 = 0x93? I am trying to create a one line text file with these characters all one one row with no spaces. ...
5
15017
by: Lenard Gunda | last post by:
hi! I have the following problem. I need to read data from a TXT file our company receives. I would use StreamReader, and process it line by line using ReadLine, however, the following problem...
12
5835
by: Adam J. Schaff | last post by:
I am writing a quick program to edit a binary file that contains file paths (amongst other things). If I look at the files in notepad, they look like: ...
10
8011
by: Nikolay Petrov | last post by:
How can I convert DOS cyrillic text to Unicode
4
2753
by: Marc Scheuner | last post by:
Folks, I have a text file which contains some XML. In its XML header, it claims to be of UTF-8 encoding - however, it's really not, it's a ANSI / Windows-1252 / ISO-8859-1 encoding. Trouble...
4
34092
by: George | last post by:
Hi, I am puzzled by the following and seeking some assistance to help me understand what happened. I have very limited encoding knowledge. Our SAP system writes out a text file which includes...
29
4832
by: list | last post by:
Hi folks, I am new to Googlegroups. I asked my questions at other forums, since now. I have an important question: I have to check files if they are binary(.bmp, .avi, .jpg) or text(.txt,...
0
7212
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7296
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7470
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5604
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4696
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3186
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
405
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.