UTF8 In FileNames Of CPP target


(Arnim) #1

Hello community,

I assume the question has been asked a thousand times before. But I did not find any proper answer in the google results.

I try to have some disk operations with HXCPP (pure cpp target (no openFl or something similar)).

But the ASCII limitations lead to an error, when I try to e.g. copy the file “erich_kästner.txt”.

I have tried the haxe.Utf8 class as well as the hx.String8 class of the haxe-string library.

I also have tried to directly escape the character within the string, like it could be done in a js target.

My questions:

  • Does anybody have a proper workflow for escaping fileName strings in cpp target?
  • Is there a similar escape for HXCPP like in js target --> “&#101” … ‘e’ ?

Thank you in advance

Kind regards


try use this setlocale may be helpful

(Arnim) #3

Thank you R32 very much for that hint and for your adaption of Björn Höhrmann’s work for HAXE.

That’s exactly what I was looking for.

Kind regards