Recent

Author Topic: Reading Russian ID3-Tags  (Read 13492 times)

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Reading Russian ID3-Tags
« Reply #15 on: January 16, 2015, 02:15:20 am »
Also, what is the difference between the FF FE  and  FE FF encoding, and what needs to be changed to let mode 2 work?
FF FE - little-endian utf16 (intel friendly)
FE FF - big-endian utf16 (ppc, sparc)

If you're processing FE FF on intel machine you'd need to swap bytes in a unicode character to get it right. Explained here

btw: repeat loop with byte operations is less effective than move().
« Last Edit: January 16, 2015, 02:18:16 am by skalogryz »

Zittergie

  • Full Member
  • ***
  • Posts: 114
    • XiX Music Player
Re: Reading Russian ID3-Tags
« Reply #16 on: January 16, 2015, 08:47:46 am »
Thanks,

I begin to understand this.  I will update mode2 with the swap.

My code uses two bytes to read UTF16, but UTF16 can also be four bytes (known as "surrogate pairs").
Would this be needed to be added and would checking on '0xD800' be enough to know if the unicode char is a surrogate pair?

Once I know the full logic, I will try to optimize the code.  For now, I just want it to work and learn to understand at the same time :)
Be the difference that makes a difference

 

TinyPortal © 2005-2018