dcsimg
Results 1 to 11 of 11

Thread: Files and Folder Unicode

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2008
    Location
    Argentina
    Posts
    210

    Files and Folder Unicode

    hello, I am doing a program and I would like to give you unicode support, this program works with files, I have had to change all the apis to the unicode version (W), 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 in the temp folder but I suppose the temp folder can have a name like "C:\Users\简化 的\AppData\Local\Temp" which does not solve the problem, which Do you do these cases?
    leandroascierto.com Visual Basic 6 projects

  2. #2
    Hyperactive Member
    Join Date
    Mar 2018
    Posts
    350

    Re: Files and Folder Unicode

    can you use something like this instead: %USERPROFILE%\AppData\Local\Temp

  3. #3
    New Member Paulo32's Avatar
    Join Date
    Oct 2018
    Posts
    2

    Re: Files and Folder Unicode


  4. #4
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    18,550

    Re: Files and Folder Unicode

    Quote Originally Posted by LeandroA View Post
    ... 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
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Dec 2008
    Location
    Argentina
    Posts
    210

    Re: Files and Folder Unicode

    Quote Originally Posted by LaVolpe View Post
    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
    ID3 unicode.zip
    leandroascierto.com Visual Basic 6 projects

  6. #6
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    2,351

    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.


    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.

  7. #7
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    18,550

    Re: Files and Folder Unicode

    Quote Originally Posted by LeandroA View Post
    ...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
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  8. #8
    Hyperactive Member
    Join Date
    Aug 2016
    Posts
    371

    Re: Files and Folder Unicode

    Quote Originally Posted by LeandroA View Post
    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
    ID3 unicode.zip
    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

  9. #9
    Hyperactive Member
    Join Date
    Aug 2016
    Posts
    371

    Re: Files and Folder Unicode

    Quote Originally Posted by LeandroA View Post
    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
    ID3 unicode.zip
    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????.

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    Dec 2008
    Location
    Argentina
    Posts
    210

    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
    leandroascierto.com Visual Basic 6 projects

  11. #11
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    2,351

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width