Move c-string utility functions from Foundation to Platform