does it work with wchar_t?
See original GitHub issueI am getting an error with wchar_t. I also included #include <stddef.h> to bypass clang error but I do get following
PANIC: [Panic] String cannot be of zero length. (Parameter 'oldValue')
at System.String.Replace(String oldValue, String newValue)
at C2CS.UseCases.AbstractSyntaxTreeC.ClangTranslationUnitExplorer.Location(CXCursor cursor, Nullable`1 type)
at C2CS.UseCases.AbstractSyntaxTreeC.ClangTranslationUnitExplorer.VisitTranslationUnit(CXTranslationUnit translationUnit)
at C2CS.UseCases.AbstractSyntaxTreeC.ClangTranslationUnitExplorer.AbstractSyntaxTree(CXTranslationUnit translationUnit, Int32 bitness)
at C2CS.UseCases.AbstractSyntaxTreeC.UseCase.Explore(CXTranslationUnit translationUnit, ImmutableArray`1 includeDirectories, ImmutableArray`1 ignoredFiles, ImmutableArray`1 opaqueTypes, ImmutableArray`1 whitelistFunctionNames, Int32 bitness)
at C2CS.UseCases.AbstractSyntaxTreeC.UseCase.Execute(Request request, Response response)
at C2CS.UseCase`2.Execute(TRequest request)
Issue Analytics
- State:
- Created 2 years ago
- Comments:20 (13 by maintainers)
Top Results From Across the Web
Is handling unicode character with wchar_t good? Does it ...
Usually, for historical reasons, we pick char for single-byte encodings (e.g. ASCII) and UTF-8, and wchar_t for UTF-16 (particularly on Windows ...
Read more >Working with Strings - Win32 apps
In this article ... Windows natively supports Unicode strings for UI elements, file names, and so forth. Unicode is the preferred character ...
Read more >Video: Create a chart
Create a chart (graph) that is recommended for your data, almost as fast as using the chart wizard that is no longer available....
Read more >How to work with UTF-8 or wchar_t characters?
Am trying to display messages with non-english charcters, but for some reason non-english characters does not seem to work as expected.
Read more >Still no wchar support? · Issue #1199 · gabime/spdlog
It works now after I define it in my client code. IMHO, this could turn down Windows users from the get-go. The info...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Sure, it could be an option that starts at the
csprogram level:Consider the case where a C library uses C strings (
char*) for identifiers that are most likely less than 25 characters in length. E.g. “PlayerEntity”, “WeaponComponent”, “RenderingSystem”, etc. These strings are used frequently and usually out of context to the global C functions as part of the API to do something significant such as getting an entity or updating a component, etc, and then returning a callback. I do not want the garbage collector in C# to allocate memory in heap 0 for these strings from the callback. Instead I rather run a quick hash over the C string and use a hashtable to know if that C string’s contents has already has an analogous memory allocated in the GC and use that reference instead.System.String.Intern(string str)would work if it accepted a raw pointer to a C style string. Otherwise, it accepts astringas input but thatstringinstance still has to be allocated first which is not great. Also, according to the docs the memory would be retained until the application exits or restarts which is not great either.