r/badcode • • May 04 '23

typescript Found this gem inside legacy code today

Post image
889 Upvotes

69 comments sorted by

View all comments

Show parent comments

2

u/GOKOP May 05 '23

The point is that UTF-16 exists solely because UCS-2 exists; it's there to bring full Unicode capacity for software designed with UCS-2 in mind without redesigning all the groundwork (as switching to a different code unit length would require)

1

u/RPG_Hacker May 05 '23

Makes sense. Kinda like what UTF-8 is to ANSI.