Re: Files and Folder Unicode
can you use something like this instead: %USERPROFILE%\AppData\Local\Temp
Re: Files and Folder Unicode
Re: Files and Folder Unicode
Quote:
Originally Posted by
LeandroA
... but now I have a problem with a third-party class module (clsID3.cls) and so as not to have to put my hand in your code I thought about working ...
My recommendation is to update the clsID3.cls to support unicode. Doing anything else may require more work, less efficiency, and potentially introduce unexpected problems.
I would think that the changes to that class would be minimal:
- changing APIs to support unicode, if needed, as needed. This may include changing some parameters to ByVal vs ByRef
- changing calls to those APIs to use StrPtr() or VarPtr() for some parameters, as needed
1 Attachment(s)
Re: Files and Folder Unicode
Quote:
Originally Posted by
LaVolpe
My recommendation is to update the clsID3.cls to support unicode. Doing anything else may require more work, less efficiency, and potentially introduce unexpected problems.
I would think that the changes to that class would be minimal:
- changing APIs to support unicode, if needed, as needed. This may include changing some parameters to ByVal vs ByRef
- changing calls to those APIs to use StrPtr() or VarPtr() for some parameters, as needed
Thanks for your response, I have performed all the file management functions to support Unicode and it works fine, but there is a problem, if I want to modify an mp3 tag, for example, the song title, and I put Chinese characters, I don't they save correctly, if I can read them well if I write them with a professional application, but in something I am failing and I cannot find my error, I have tried to code in UTF8 and UTF16 but it continues writing badly
I appreciate if you have time to look at it
Attachment 171953
Re: Files and Folder Unicode
If it's just MP3's and just basic tags, there's about 15 tags you can read/write through the Windows Property System instead. It's easier than manually writing in an mp3 file, but no one's made a class for it so it's still a bit tough from scratch... but Unicode is no trouble.
You can even read album art this way... I just tried that now actually I don't know how to write it yet but it should be possible.
https://i.imgur.com/zs4Tj6B.jpg
I wrote a Unicode chess set to the album title.
I really need to make a property writing standalone demo, but if you wanted to dig through it this is my shell browser project.
(cover art isn't in the public version yet but I just added mp3s to what gets sent to a function called AddThumbviewVideoISI from the main AddThumbView routine)
Doing things through Windows also means you can handle image properties the same way.
It's a long shot this is useful for you but since I was just talking about reading/writing ID3 tags in unicode using these methods... can't hurt to note it.
Re: Files and Folder Unicode
Quote:
Originally Posted by
LeandroA
...if I want to modify an mp3 tag, for example, the song title, and I put Chinese characters, I don't they save correctly, if I can read them well if I write them with a professional application, but in something I am failing and I cannot find my error, I have tried to code in UTF8 and UTF16 but it continues writing badly
I'm not familiar enough with ID3 specifications to answer your question. The specifications are found at ID3.org
If unicode tags are going to be used, there is a special bit that needs to be set to indicate what the text encoding is. I'm thinking that is the reason for the tag not written correctly. I'm sure you can find a solution by searching for "unicode ID3 tags".
As a side note... You are parsing a binary file as text. StrConv() can result in binary data being changed in some cases. Never recommend parsing RIFF-style formats as text
Re: Files and Folder Unicode
Quote:
Originally Posted by
LeandroA
Thanks for your response, I have performed all the file management functions to support Unicode and it works fine, but there is a problem, if I want to modify an mp3 tag, for example, the song title, and I put Chinese characters, I don't they save correctly, if I can read them well if I write them with a professional application, but in something I am failing and I cannot find my error, I have tried to code in UTF8 and UTF16 but it continues writing badly
I appreciate if you have time to look at it
Attachment 171953
Private Type Mp3tag
Title(29) As Byte '
Artist(29) As Byte '
Album(29) As Byte '
Year(3) As Byte '
Comment(29) As Byte '
Genre As Byte '
End Type
Private Type ID3Header
ID As String * 3
Version As Integer '
flag As Byte '
Size(3) As Byte '
End Type
Dim ID3V1Info As Mp3tag, i As Integer, tem() As Byte, TAG As String * 3
TAG = "TAG"
With ID3V1Info
tem = StrConv(Text1(0), vbFromUnicode): CopyMemory .Title(0), tem(0), UBound(tem) + 1 '
tem = StrConv(Text1(1), vbFromUnicode): CopyMemory .Artist(0), tem(0), UBound(tem) + 1 '
tem = StrConv(Text1(2), vbFromUnicode): CopyMemory .Album(0), tem(0), UBound(tem) + 1 '
tem = StrConv(Text1(5), vbFromUnicode): CopyMemory .Comment(0), tem(0), UBound(tem) + 1 '
tem = StrConv(Left(Text1(4) & String(4, 0), 4), vbFromUnicode): CopyMemory .Year(0), tem(0), 4 '
i = Val(Text1(3)): If i > 255 Then i = 255
If Len(Text1(2)) > 0 And i > 0 Then .Comment(28) = 0: .Comment(29) = i '
For i = 0 To Combo1.ListCount - 1 '
If Combo1.List(i) = Combo1.Text Then Exit For
Next
If i = 0 Or i = Combo1.ListCount Then i = 256
.Genre = i - 1
End With
Open SaveName For Binary As #1
Seek #1, LOF(1) + 1
Put #1, , TAG
Put #1, , ID3V1Info
100
Close
Re: Files and Folder Unicode
Quote:
Originally Posted by
LeandroA
Thanks for your response, I have performed all the file management functions to support Unicode and it works fine, but there is a problem, if I want to modify an mp3 tag, for example, the song title, and I put Chinese characters, I don't they save correctly, if I can read them well if I write them with a professional application, but in something I am failing and I cannot find my error, I have tried to code in UTF8 and UTF16 but it continues writing badly
I appreciate if you have time to look at it
Attachment 171953
In Chinese operating systems. Reading access files is best done in an array.
Read the file in your code. By strconv(xx, vbunicode), the string will appear Garbled ????.
When you store it, it will garble strconv (yy, VBformUnicode) will save the garbled????.
Re: Files and Folder Unicode
Thanks for your answers, I could not solve the problem with this class module (at least for the moment) so I decided to opt for the Fafalone option), I have worked a bit with your idea, although I do not think I can use different types of images (front cover, back cover etc.) is enough for my purpose.
http://www.vbforums.com/showthread.p...=1#post5428963
Re: Files and Folder Unicode
Alas no, Windows doesn't have different PROPERTYKEY's for the different art options, and deals only with the image data itself, rather than the full APIC frame. So it would seem limited to the single, main image.
The IMFMetaData interface might support writing the full frame... I'll have to look into that more; none of the Windows Media Foundation interfaces exist in a VB6-compatible form yet however. New TLB addition incoming :)