473,409 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,409 software developers and data experts.

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(myPlaylist);

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(myPlaylist,Encoding.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(myPlaylist,Encoding.UTF7,true);

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

Thank you

Nov 15 '05 #1
7 1485
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.745550$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(myPlaylist);

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(myPlaylist,Encoding.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(myPlaylist,Encoding.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.Default? 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.745550$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(myPlaylist);

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(myPlaylist,Encoding.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(myPlaylist,Encoding.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(myPlaylist);

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(myPlaylist,Encoding.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(myPlaylist,Encoding.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.com>
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.Default 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.Default? 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.745550$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(myPlaylist);

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(myPlaylist,Encoding.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(myPlaylist,Encoding.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.CodePageEncoding 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.745550$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(myPlaylist);

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(myPlaylist,Encoding.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(myPlaylist,Encoding.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.758605$Fm2.705428@attbi_s04...
/me thwaps himself. Using Encoding.Default 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.Default? 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.745550$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(myPlaylist);

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(myPlaylist,Encoding.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(myPlaylist,Encoding.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.758605$Fm2.705428@attbi_s04...
/me thwaps himself. Using Encoding.Default 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.Default? 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.745550$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(myPlaylist);

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(myPlaylist,Encoding.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(myPlaylist,Encoding.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
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...
9
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 ->...
3
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...
0
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...
11
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...
14
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...
5
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...
13
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...
20
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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
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,...

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.