Menu

#249 utf8 string typemaps for C#

None
closed
None
5
2022-05-02
2010-12-13
No

C# P/Invoke supports UTF-16 and ASCII encodings out of the box. Mono supports UTF-8 but MS CLR does not. Here you can find typemaps for handling utf-8 strings portably.

I did not create a manual entry. There are examples and quite comprehensive documentation in the .i file. IMO it suffices if it is mentioned in the manual that also UTF-8 enconding is supported when passing strings to the native code and reader is referred to read the documentation in the utf8_strings.i file and the examples. This is to keep the manual from (further) bloat - UTF-8 strings are of interest only if you are using a native API that expects that encoding and I don't think they are all that common (not sure, though).

Discussion

  • Antti Karanta

    Antti Karanta - 2010-12-13
     
  • Olly Betts

    Olly Betts - 2022-03-17

    Still seems relevant.

     
  • William Fulton

    William Fulton - 2022-05-02
    • status: open --> closed
    • assigned_to: William Fulton
    • Group: -->
     
  • William Fulton

    William Fulton - 2022-05-02

    Solution in https://github.com/swig/swig/issues/1233 has been adopted instead, mainly to avoid the use of unsafe.

     

Log in to post a comment.