Re: Filename Encoding Help
- From: Göran Andersson <guffa@xxxxxxxxx>
- Date: Mon, 09 Jun 2008 00:41:07 +0200
Adhal wrote:
Hello,
On Vista & XP, I want to store filenames in a text file. What encoding should I use?
UTF16 (Encoding.Unicode)
OR
UTF32 (Encoding.UTF32).
I think UTF16 is enough? Anyway that is what I am currently using.
You can use any unicode encoding, like UTF-7, UTF-8, UTF-16 or UTF-32.
I suggest UTF-8, it's the most efficient for regular text, and it's the default for all methods reading and writing text files in .NET.
One other question. If I have a Japanese system and I again I want to store the filenames in a text file but this time not Unicode, should I use:
A) ANSI (Encoding.Default)
B) ASCII (Encoding.ASCII)
My understanding is that I should use Encoding.Default as it is set according to the system. I really don't know the difference between the two as they seem alike.
That depends on what characters the file names contains. The ASCII encoding only handles characters with character codes from 32 to 127. The ANSI character set will handle any characters in the ASCII character set.
It also depends on what you are going to use the file for. Is there any other program that will read the file?
--
Göran Andersson
_____
http://www.guffa.com
.
- Follow-Ups:
- Re: Filename Encoding Help
- From: Adhal
- Re: Filename Encoding Help
- Prev by Date: Re: Vista debug Issue
- Next by Date: Re: Filename Encoding Help
- Previous by thread: ObservableCollection - notification when item has changed (not the collection)
- Next by thread: Re: Filename Encoding Help
- Index(es):
Relevant Pages
|
Loading