I have this code:
temp_dir = ON_MAC ? (File.join(ENV['HOME'],"Library","Application Support")) : ((ENV['APPDATA']))
temp_dir = temp_dir.dup.force_encoding("UTF-8")
user_data = File.join(temp_dir,"ProfileBuilder")
Later on, this gets called:
USER_DATA = ProfileBuilder2.get_user_data()
Dir.mkdir(USER_DATA) unless FileTest.exist?(USER_DATA)
The mkdir line fails and I think it is because of the non-English characters in the username. This is the partial output.
Error: c:/users/oscar grönlund/appdata/roaming/sketchup/sketchup 2017/sketchup/plugins/dm_profilebuilder2/profilebuilder.rbe:897:in `mkdir'
I am confused because I thought my 'force_encoding' is supposed to take care of non-english characters. Is this a system-dependent error? Because I have only seen two reports of this issue and I am sure I have lots of other users that have non-English characters in their usernames. Is it related to Windows version perhaps?