Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML 2 image::SaveToFile does not support utf8?  (Read 2245 times)

0 Members and 1 Guest are viewing this topic.

dvoid

  • Newbie
  • *
  • Posts: 7
    • View Profile
SFML 2 image::SaveToFile does not support utf8?
« on: February 09, 2011, 03:25:25 pm »
im trying to use image::SaveToFile with an utf8 encoded string, but it fails. im guessing its not supported? would be nice with a FILE* version of SaveToFile. and maybe a SaveToMemory =)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML 2 image::SaveToFile does not support utf8?
« Reply #1 on: February 09, 2011, 03:44:27 pm »
UTF-8 filenames will most likely be supported in SFML 2.

Abstract data access for resources may also be implemented one day.

For now you can just convert your UTF-8 string manually before calling SaveToFile.
Laurent Gomila - SFML developer

dvoid

  • Newbie
  • *
  • Posts: 7
    • View Profile
SFML 2 image::SaveToFile does not support utf8?
« Reply #2 on: February 09, 2011, 03:58:25 pm »
what do you mean convert it manually?
it is already in utf8 format? what should i convert it to?

i need to be able to save files to the users home directory , which is a unicode
path encoded in utf8  ( that is a non wide string ) .

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML 2 image::SaveToFile does not support utf8?
« Reply #3 on: February 09, 2011, 05:05:51 pm »
I don't have much control on the third-party libraries that I use for image loading/saving, but I guess they yse the current global locale's encoding.
Laurent Gomila - SFML developer

 

anything