473,654 Members | 3,253 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Best of both encoding worlds?

I wrote a front end to a command line mp4 music tagger that reads
my playlist files and gets info such as artist, title, album, etc,
etc. I use the info to catalog, tag, sort, etc, my files. I've run
into a small encoding problem. I started using a fopen like so.

fopen = new StreamReader(my Playlist);

Everything worked well until I ran into groups like Mötley Crüe
with strange chars in the title. The default encoding above failed
to recognise the odd chars in "Mötley Crüe". I then went to

fopen = new StreamReader(my Playlist,Encodi ng.UTF7);

This correctly picked up the odd chars in Mötley Crüe, and
everything else I thought until I noticed a file with a '+' in
the file name wasn't getting picked up now. My question is for
lack of a better one, is there anyway to use both encodings at
the same time? I did try every other encoding besides UTF7 and
also tried:

fopen = new StreamReader(my Playlist,Encodi ng.UTF7,true);

I'm out of ideas here :/ Any advice is much appreciated.

Thank you

Nov 15 '05 #1
7 1498
Well, you should find out what encoding your playlist file uses, and use the
same.

-mike
MVP

"polarz" <po****@hotmail .com> wrote in message
news:Ru6Kb.7455 50$Tr4.2061678@ attbi_s03...
I wrote a front end to a command line mp4 music tagger that reads
my playlist files and gets info such as artist, title, album, etc,
etc. I use the info to catalog, tag, sort, etc, my files. I've run
into a small encoding problem. I started using a fopen like so.

fopen = new StreamReader(my Playlist);

Everything worked well until I ran into groups like Mötley Crüe
with strange chars in the title. The default encoding above failed
to recognise the odd chars in "Mötley Crüe". I then went to

fopen = new StreamReader(my Playlist,Encodi ng.UTF7);

This correctly picked up the odd chars in Mötley Crüe, and
everything else I thought until I noticed a file with a '+' in
the file name wasn't getting picked up now. My question is for
lack of a better one, is there anyway to use both encodings at
the same time? I did try every other encoding besides UTF7 and
also tried:

fopen = new StreamReader(my Playlist,Encodi ng.UTF7,true);

I'm out of ideas here :/ Any advice is much appreciated.

Thank you

Nov 15 '05 #2
This may sound obvious (seeing as you said you tried every encoding
available), but have you tried Encoding.Defaul t? Default encoding is ANSI
which includes the 7-Bit ASCII characters and then some.

Hope this helps,
Jacob
"polarz" <po****@hotmail .com> wrote in message
news:Ru6Kb.7455 50$Tr4.2061678@ attbi_s03...
I wrote a front end to a command line mp4 music tagger that reads
my playlist files and gets info such as artist, title, album, etc,
etc. I use the info to catalog, tag, sort, etc, my files. I've run
into a small encoding problem. I started using a fopen like so.

fopen = new StreamReader(my Playlist);

Everything worked well until I ran into groups like Mötley Crüe
with strange chars in the title. The default encoding above failed
to recognise the odd chars in "Mötley Crüe". I then went to

fopen = new StreamReader(my Playlist,Encodi ng.UTF7);

This correctly picked up the odd chars in Mötley Crüe, and
everything else I thought until I noticed a file with a '+' in
the file name wasn't getting picked up now. My question is for
lack of a better one, is there anyway to use both encodings at
the same time? I did try every other encoding besides UTF7 and
also tried:

fopen = new StreamReader(my Playlist,Encodi ng.UTF7,true);

I'm out of ideas here :/ Any advice is much appreciated.

Thank you

Nov 15 '05 #3
polarz <po****@hotmail .com> wrote:
I wrote a front end to a command line mp4 music tagger that reads
my playlist files and gets info such as artist, title, album, etc,
etc. I use the info to catalog, tag, sort, etc, my files. I've run
into a small encoding problem. I started using a fopen like so.

fopen = new StreamReader(my Playlist);

Everything worked well until I ran into groups like Mötley Crüe
with strange chars in the title. The default encoding above failed
to recognise the odd chars in "Mötley Crüe". I then went to

fopen = new StreamReader(my Playlist,Encodi ng.UTF7);

This correctly picked up the odd chars in Mötley Crüe, and
everything else I thought until I noticed a file with a '+' in
the file name wasn't getting picked up now. My question is for
lack of a better one, is there anyway to use both encodings at
the same time? I did try every other encoding besides UTF7 and
also tried:

fopen = new StreamReader(my Playlist,Encodi ng.UTF7,true);

I'm out of ideas here :/ Any advice is much appreciated.


It sounds like UTF7 just isn't the encoding used. It's very unlikely to
be the one used - I've very rarely actually come across applications
which use it. What's generating the playlist file, and do you have any
documentation about the format?

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #4
/me thwaps himself. Using Encoding.Defaul t worked, I assumed by
leaving the fopen with no specific encoding it would use the
default encoding. Sorry for the dumb question and thanks for the
replys.

Jacob wrote:
This may sound obvious (seeing as you said you tried every encoding
available), but have you tried Encoding.Defaul t? Default encoding is ANSI
which includes the 7-Bit ASCII characters and then some.

Hope this helps,
Jacob
"polarz" <po****@hotmail .com> wrote in message
news:Ru6Kb.7455 50$Tr4.2061678@ attbi_s03...
I wrote a front end to a command line mp4 music tagger that reads
my playlist files and gets info such as artist, title, album, etc,
etc. I use the info to catalog, tag, sort, etc, my files. I've run
into a small encoding problem. I started using a fopen like so.

fopen = new StreamReader(my Playlist);

Everything worked well until I ran into groups like Mötley Crüe
with strange chars in the title. The default encoding above failed
to recognise the odd chars in "Mötley Crüe". I then went to

fopen = new StreamReader(my Playlist,Encodi ng.UTF7);

This correctly picked up the odd chars in Mötley Crüe, and
everything else I thought until I noticed a file with a '+' in
the file name wasn't getting picked up now. My question is for
lack of a better one, is there anyway to use both encodings at
the same time? I did try every other encoding besides UTF7 and
also tried:

fopen = new StreamReader(my Playlist,Encodi ng.UTF7,true);

I'm out of ideas here :/ Any advice is much appreciated.

Thank you


Nov 15 '05 #5
Thanks for the reply Mike. I had already tried that and got
System.Text.Cod ePageEncoding which can't be accessed due to
its protection level. I found an answer to my question in one
of the other responses. Thanks again.

Michael Giagnocavo [MVP] wrote:
Well, you should find out what encoding your playlist file uses, and use
the same.

-mike
MVP

"polarz" <po****@hotmail .com> wrote in message
news:Ru6Kb.7455 50$Tr4.2061678@ attbi_s03...
I wrote a front end to a command line mp4 music tagger that reads
my playlist files and gets info such as artist, title, album, etc,
etc. I use the info to catalog, tag, sort, etc, my files. I've run
into a small encoding problem. I started using a fopen like so.

fopen = new StreamReader(my Playlist);

Everything worked well until I ran into groups like Mötley Crüe
with strange chars in the title. The default encoding above failed
to recognise the odd chars in "Mötley Crüe". I then went to

fopen = new StreamReader(my Playlist,Encodi ng.UTF7);

This correctly picked up the odd chars in Mötley Crüe, and
everything else I thought until I noticed a file with a '+' in
the file name wasn't getting picked up now. My question is for
lack of a better one, is there anyway to use both encodings at
the same time? I did try every other encoding besides UTF7 and
also tried:

fopen = new StreamReader(my Playlist,Encodi ng.UTF7,true);

I'm out of ideas here :/ Any advice is much appreciated.

Thank you


Nov 15 '05 #6
No prob.

Jacob

"polarz" <po****@hotmail .com> wrote in message
news:0djKb.7586 05$Fm2.705428@a ttbi_s04...
/me thwaps himself. Using Encoding.Defaul t worked, I assumed by
leaving the fopen with no specific encoding it would use the
default encoding. Sorry for the dumb question and thanks for the
replys.

Jacob wrote:
This may sound obvious (seeing as you said you tried every encoding
available), but have you tried Encoding.Defaul t? Default encoding is ANSI which includes the 7-Bit ASCII characters and then some.

Hope this helps,
Jacob
"polarz" <po****@hotmail .com> wrote in message
news:Ru6Kb.7455 50$Tr4.2061678@ attbi_s03...
I wrote a front end to a command line mp4 music tagger that reads
my playlist files and gets info such as artist, title, album, etc,
etc. I use the info to catalog, tag, sort, etc, my files. I've run
into a small encoding problem. I started using a fopen like so.

fopen = new StreamReader(my Playlist);

Everything worked well until I ran into groups like Mötley Crüe
with strange chars in the title. The default encoding above failed
to recognise the odd chars in "Mötley Crüe". I then went to

fopen = new StreamReader(my Playlist,Encodi ng.UTF7);

This correctly picked up the odd chars in Mötley Crüe, and
everything else I thought until I noticed a file with a '+' in
the file name wasn't getting picked up now. My question is for
lack of a better one, is there anyway to use both encodings at
the same time? I did try every other encoding besides UTF7 and
also tried:

fopen = new StreamReader(my Playlist,Encodi ng.UTF7,true);

I'm out of ideas here :/ Any advice is much appreciated.

Thank you

Nov 15 '05 #7
What happens if the playlist has a song from ????

-Mike
MVP

"polarz" <po****@hotmail .com> wrote in message
news:0djKb.7586 05$Fm2.705428@a ttbi_s04...
/me thwaps himself. Using Encoding.Defaul t worked, I assumed by
leaving the fopen with no specific encoding it would use the
default encoding. Sorry for the dumb question and thanks for the
replys.

Jacob wrote:
This may sound obvious (seeing as you said you tried every encoding
available), but have you tried Encoding.Defaul t? Default encoding is ANSI which includes the 7-Bit ASCII characters and then some.

Hope this helps,
Jacob
"polarz" <po****@hotmail .com> wrote in message
news:Ru6Kb.7455 50$Tr4.2061678@ attbi_s03...
I wrote a front end to a command line mp4 music tagger that reads
my playlist files and gets info such as artist, title, album, etc,
etc. I use the info to catalog, tag, sort, etc, my files. I've run
into a small encoding problem. I started using a fopen like so.

fopen = new StreamReader(my Playlist);

Everything worked well until I ran into groups like Mötley Crüe
with strange chars in the title. The default encoding above failed
to recognise the odd chars in "Mötley Crüe". I then went to

fopen = new StreamReader(my Playlist,Encodi ng.UTF7);

This correctly picked up the odd chars in Mötley Crüe, and
everything else I thought until I noticed a file with a '+' in
the file name wasn't getting picked up now. My question is for
lack of a better one, is there anyway to use both encodings at
the same time? I did try every other encoding besides UTF7 and
also tried:

fopen = new StreamReader(my Playlist,Encodi ng.UTF7,true);

I'm out of ideas here :/ Any advice is much appreciated.

Thank you

Nov 15 '05 #8

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

Similar topics

3
1448
by: Ares Lagae | last post by:
Suppose one is writing a library behavior the classes A1, A2 and A3, which share some common behavior. Some applications will only use one of the classes, while other applications will use all of them. Because the classes share common behavior, the library designed has to choose wether to introduce an abstract base class A, or not. Introducing an ABC has the advantage of run time flexibility, but efficiency suffers (virtual functions &...
9
14237
by: PAN | last post by:
I need some guidance here I've written this HTML code using the Windows Notebook: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EL"> <html> <head> <title>This is a Greek language title -> êáñõäÜò ðëçñïöïñéêÞ</title> </head> <body>
3
2616
by: Amy L. | last post by:
I have a client / server application. I just want to encrypt small amounts of data 1<x<1024 characters or so. I need to load the same Key and IV in both applications. However, both the key and IV are byte arrays. What is the best way to get the keys loaded in both applications? For example in RSA you can export the keys to XML. Can you do this in Rijndael? I tried using System.Text.Encoding.UTF8 or ASCII, but this does not appear...
0
2691
by: Johannes Unfried | last post by:
Problem Best practice needed to marshal STL data from managed code to unmanaged code & vice vers Details managed code is written in managed C++ & accesses the unmanaged code (i.e. lives in a mixed mode DLL unmanaged code is written in unmanaged C++ & resides in an unmanaged DL Product used is VS.NET 200 Please tell me what is the best practice for getting and setting data fro unmanaged to managed part when I have a class with...
11
4132
by: kiln | last post by:
I am starting a project that may be suitable for vb.net, using windows forms. I want a rich client, thus win forms vs web forms. Most users will access the app data over a LAN, but some will be remote users, accessing via vpn. I could use terminal services for this but am thinking that an alternate technology like remoting or web servies could be viable. - Rich client - N-Tier - LAN & Internet clients (via VPN)
14
4848
by: Mac via DotNetMonster.com | last post by:
Hi all, As some of you would know from my previous posts that I am rewriting our Unix based system into .Net with a MDI interface. Recently I have added a tab control to the top of the MDI parent form that will contain a tab page for each open MDI child form. It is only 24 pixels high so all you see is the tabstrip. Then I only have to add a bit of code to the "changed index" event of the tab control as well as the "on activate" event...
5
2050
by: Edward | last post by:
I've been running into issue after issue trying to position text with pure CSS (ie 3-pixel bug, margin bugs, inexplainable side-effects, etc.). I noted that I can just put an HTML table anywhere I want on the screen, set DIVs inside there, and for the most part, I get the structure I want quickly and can continue to use my style sheet for the divs. And as far as I understand, even though this is not pure separation of design and content,...
13
2489
by: BK | last post by:
Our .Net team has just inherited a junior programmer that we need to get up to speed as quickly as possible. Unfortunately, his skill set is largely Access with some VB6 and ASP classic experience. We employ some parts of XP such as pair programming, and this should help. Other than books, does anyone have any suggestions? His skill set is pretty antiquated and we need to get him up to speed as quickly as possible so any suggestions...
20
10020
by: Joe | last post by:
Is any one charting packing considered to be the "best"? We've used ChartFX but wasn't too happy about the way data had to be populated along with some other issues which slip my mind right now and Dundas has bugs and doesn't do a good enough job displaying axis labels and is very slow to paint large numbers of series and data points. We're currently evaluating ProEssentials which we are happy with but it's not a native .NET package. ...
0
8379
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8294
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8494
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7309
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5627
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4297
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1924
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.