Author Topic: Wrong codepage in the non-Unicode tags  (Read 102 times)

ter

  • Posts: 9
Wrong codepage in the non-Unicode tags
« on: 21 Feb '21 - 16:37 »
Hi, I'm getting the wrong codepage in the non-Unicode tags

Tags are ID3v1 and ID3v2

I'm using Delphi 7 and XE7

Code: [Select]
    Artist:={$IFDEF UNICODE}UTF8ToString({$ENDIF} TAGS_Read(Channel, PAnsiChar('%ARTI')) {$IFDEF UNICODE}){$ENDIF};
« Last Edit: 21 Feb '21 - 18:56 by ter »

Ian @ un4seen

  • Administrator
  • Posts: 23404
Re: Wrong codepage in the non-Unicode tags
« Reply #1 on: 22 Feb '21 - 17:47 »
It isn't possible for the TAGS add-on to know what the correct codepage is for non-Unicode tags, but it should use Windows' "Language for non-Unicode programs" setting (in the "Region" control panel), so you can try changing it there.

ter

  • Posts: 9
Re: Wrong codepage in the non-Unicode tags
« Reply #2 on: 26 Feb '21 - 06:47 »
This is a topic from 2015:
http://www.un4seen.com/forum/?topic=16284.0

Quote
UPD: BASS is using Windows-1252, while it should use system default encoding instead.

It is not using "Language for non-Unicode programs" setting.

Ian @ un4seen

  • Administrator
  • Posts: 23404
Re: Wrong codepage in the non-Unicode tags
« Reply #3 on: 26 Feb '21 - 16:04 »
Oops, my reply was indeed incorrect: the system codepage is used when converting Unicode tags to ANSI, not the other way round. You can use TAGS_ReadEx (instead of TAGS_Read) to specify a codepage to use when reading non-Unicode tags.

ter

  • Posts: 9
Re: Wrong codepage in the non-Unicode tags
« Reply #4 on: 26 Feb '21 - 18:51 »
What are the parameters for the TAGS_ReadEx? For example tagtype. What if ID3v2 is missing and there is only ID3v1, or vice versa? What about other types of tags - ogg/flac? How to read the most appropriate tag with one operation?

Ian @ un4seen

  • Administrator
  • Posts: 23404
Re: Wrong codepage in the non-Unicode tags
« Reply #5 on: 1 Mar '21 - 17:08 »
You can set the TAGS_ReadEx "tagtype" parameter to -1 to check all tags, like TAGS_Read does. Full details on parameters are included in the TAGS-README.TXT file.