String conversion error illegal byte sequence encounted in the input

System.ExecutionEngineException #6529

Comments

I try to run application but get this error

System.ExecutionEngineException
String conversion error: Illegal byte sequence encounted in the input.
at (wrapper managed-to-native) System.Runtime.InteropServices.Marshal.PtrToStringAnsi(intptr)
at Microsoft.Xna.Framework.Audio.Microphone.PopulateCaptureDevices () [0x00081] in :0
at Microsoft.Xna.Framework.Audio.OpenALSoundController..ctor () [0x0003b] in :0
at Microsoft.Xna.Framework.Audio.OpenALSoundController.get_GetInstance () [0x00007] in :0
at Microsoft.Xna.Framework.SdlGamePlatform..ctor (Microsoft.Xna.Framework.Game game) [0x000d2] in :0
at Microsoft.Xna.Framework.GamePlatform.PlatformCreate (Microsoft.Xna.Framework.Game game) [0x00000] in :0
at Microsoft.Xna.Framework.Game..ctor () [0x001fb] in :0
at Terminal.Payment.UI.Game1..ctor () [0x00000] in /media/destructor/Documents/Projects/TestSistema/TestSistema/Game1.cs:19
at Terminal.Payment.UI.Program.Main () [0x00001] in /media/destructor/Documents/Projects/TestSistema/TestSistema/Program.cs:17

Working directory

System Stats

  • MonoGame 3.7 from Nuget
  • Debian 9
  • Mono 5.16
  • .Net Framework is 4.7.1

What MonoGame platform are you using:

The text was updated successfully, but these errors were encountered:

Источник

Chinese characters cause «String conversion error: Illegal byte sequence encounted in the input.» #7117

Comments

Hi I’m running a dot net application under windows with mono. I have created library in C program to load my dot net application, but i found a bug in g_utf8_to_utf16 function.When my program is placed in a path with a Chinese character,mono can not load assembly, and all Chinese characters in path become messy codes. It causes the program can’t work correctly. After referenced the source code, I found that this is the result of the error of the g_utf8_to_utf16 function, it converts English characters but does not convert Chinese characters, eg ‘汉’. it will throw «String conversion error: Illegal byte sequence encounted in the input».This made me quite upset,because my program will run on the Chinese version of the Windows,I really do not know how to do. I think mono should support Wide char(wchar_t),That will make it easier for people in more countries to use.

The text was updated successfully, but these errors were encountered:

Could you help us to reproduce the issue with the sample we can use?

This is my C program:

After debugging,I found where the problem was : mono_file_map_open

Is there any other solution to this problem?
Or are some of the parameters not set right?

@jaykrell are you familiar with this code?

Call stack would be nice.

Windows 8 bit strings are generally not utf8, but are being treated here as so.
That is likely the problem.

The right fix is that mono should use unichar2 or wchar_t (more) extensively and avoid converting to 8 bits, except at the Posix boundary. This is how Windows works and is not unreasonable for all software. wchar_t is widely supported, not just on Windows. It doubles or quadruples some memory use, but that is already largely happening anyway. We and much other software already traffic extensively in wchar or unichar2 on all platforms.

Читайте также:  Ssd adata обновление прошивки

1 The obnoxious non-fix is to tell user to call MultiByteToWideChar(CP_ACP) and then WideCharToMultiByte(CP_UTF8) on all 8 bit input before passing it to mono.
He has done something likely invalid but only subtley so.

2 A practical and friendly fix is wherever monoapi has mono_foo(const char* presumed_utf8) also
provide mono_foo_w(const wchar_t*), implemented by converting to utf8 and calling mono_foo.
(Very long term, the layering could/should be reversed, but that is probably never.)

«w» is for «wide» — for any given string-taking function CreateFile, Windows actually has CreateFIleW that takes wchar_t and CreateFileA that takes an 8bit string, in code page that can vary per user and per thread but is rarely UTF8 (only recently did Windows allow UTF8 as the implicit codepage).
While this ugly to be sure, it is a widely used existing practise and does work.
So follow that on a small scale. To start, one function, mono_domain_assembly_open_w.

The user’s code would remain invalid and not working, but easy to fix.
He would change char to wchar_t and A to W, «str» to «wcs», and append «_w» at the mono boundary.

3 Another gross fix, and risky because it might not work, is to try to pass the string through unmodified, to fopen instead _wfopen. This is risky because it depends on carefully never assuming the encoding of user input, and assuming whatever we pass it to agrees (it would in this case). And we’d have to discern user input from our own utf8 data. If our data is always 7-bit clean, then it is viable.

I suggest 2. It is small. It can be done incrementally but will never be huge — a bunch of one liners. It doesn’t contradict 1 or 3, but is more practical than 1 and more helpful than 3.

Источник

Exception in AST.Declaration VisitClassTemplate #1165

Comments

Brief Description

I am trying to create a cs interface to my c++ project under linux. I am using CPPSharp.CLI.exe and am running the latest master build and latest clang + llvm. I also tried the last stable version 0.8.22 with exact matching llvm and clang refspecs and experienced the same issue:

Not able to convert the type CppSharp.Parser.AST.ClassTemplateSpecialization (CppSharp.Parser.AST.DeclarationContext::basic_istream) since the resulting type CppSharp.AST.Class (std::basic_istream) cannot be cast to AST.ClassTemplateSecialization.

At a later stage I now get an Exception, but that may be a different issue.

Generating C# bindings for Linux x64.
Parsing libraries.
Parsing code.
Parsed ‘/home/dave/workspace/mw_trunk/mwcutsim/mwVerifierInterface/mwMachSimVerifier.hpp’
couldnt convert type CppSharp.Parser.AST.ClassTemplateSpecialization (CppSharp.Parser.AST.DeclarationContext::basic_istream) since the type after visiting CppSharp.AST.Class (std::basic_istream) cannot be cast to AST.ClassTemplateSecialization
String conversion error: Illegal byte sequence encounted in the input. at (wrapper managed-to-native) System.Runtime.InteropServices.Marshal.PtrToStringAnsi(intptr)
at Std.BasicStringExtensions.CStr (Std.BasicString3[_CharT,_Traits,_Alloc] this) [0x00026] in /home/dave/workspace/CppSharp.git/src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/Std.cs:986
at CppSharp.Parser.AST.Declaration.get_DebugText () [0x0001e] in /home/dave/workspace/CppSharp.git/src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/CppSharp.CppParser.cs:4599
at CppSharp.DeclConverter.VisitDeclaration (CppSharp.Parser.AST.Declaration decl, CppSharp.AST.Declaration _decl) [0x000b1] in /home/dave/workspace/CppSharp.git/src/Parser/ASTConverter.cs:954
at CppSharp.DeclConverter.VisitNamespace (CppSharp.Parser.AST.Namespace decl) [0x0000a] in /home/dave/workspace/CppSharp.git/src/Parser/ASTConverter.cs:1090
at CppSharp.DeclVisitor1[TRet].Visit (CppSharp.Parser.AST.Declaration decl) [0x000b4] in /home/dave/workspace/CppSharp.git/src/Parser/ASTConverter.cs:184
at CppSharp.DeclConverter.Visit (CppSharp.Parser.AST.Declaration decl) [0x0006b] in /home/dave/workspace/CppSharp.git/src/Parser/ASTConverter.cs:854
at CppSharp.DeclConverter.VisitDeclContext (CppSharp.Parser.AST.DeclarationContext ctx, CppSharp.AST.DeclarationContext _ctx) [0x00013] in /home/dave/workspace/CppSharp.git/src/Parser/ASTConverter.cs:991
at CppSharp.ASTConverter.Convert () [0x00086] in /home/dave/workspace/CppSharp.git/src/Parser/ASTConverter.cs:409
at CppSharp.ClangParser.ConvertASTContext (CppSharp.Parser.AST.ASTContext context) [0x00009] in /home/dave/workspace/CppSharp.git/src/Parser/Parser.cs:81
at CppSharp.Driver.ParseCode () [0x001ef] in /home/dave/workspace/CppSharp.git/src/Generator/Driver.cs:162
at CppSharp.ConsoleDriver.Run (CppSharp.ILibrary library) [0x00090] in /home/dave/workspace/CppSharp.git/src/Generator/Driver.cs:428
at CppSharp.Generator.Run () [0x0014f] in /home/dave/workspace/CppSharp.git/src/CLI/Generator.cs:259
at CppSharp.CLI.Main (System.String[] args) [0x00044] in /home/dave/workspace/CppSharp.git/src/CLI/CLI.cs:279

Unhandled Exception:
System.ExecutionEngineException: String conversion error: Illegal byte sequence encounted in the input.
at CppSharp.CLI.Main (System.String[] args) [0x00075] in /home/dave/workspace/CppSharp.git/src/CLI/CLI.cs:286
[ERROR] FATAL UNHANDLED EXCEPTION: System.ExecutionEngineException: String conversion error: Illegal byte sequence encounted in the input.
at CppSharp.CLI.Main (System.String[] args) [0x00075] in /home/dave/workspace/CppSharp.git/src/CLI/CLI.cs:286

OS: Windows / OS X / Linux (include version and/or distro)
Linux (Ubuntu 18.10)

Читайте также:  Posua vfd usb прошивка
Used headers
Used settings

Target: MSVC/GCC/Clang
Clang (but had a similar issue with Gcc)

Stack trace or incompilable generated code

I have modified the function to get some insights. Before doing so an exception was thrown because an invalid cast was happening. Now I omit that but show the message.

The text was updated successfully, but these errors were encountered:

Источник

Weird `ExecutionEngineException: String conversion error: Illegal byte sequence encounted in the input` on Windows about kspe HOT 1 OPEN

Comments (1)

There’s very good chance that we may be dealing with an environmental problem (or, at least, trigger).

In order to use it, one need to unzip it somewhere and then:

/Workspaces/…. should be replaced by the pathname of your KSP’s rigs you wanna test (yeah, you can run it on more than one). If the pathname have spaces or similar weirdyties you need to use double quotes on the pathnames:

The output will be something similar to this:

Assemblies that eventually fail the check will have an Exception name instead of an Ok on the line.

You can (or should) redirect the output to a file, so you can attach it on a post here or send me by mail:

A file called results.txt will be created on the current directory with the output.

  • Ensure this is working fine on KSP 1.12.x HOT 1
  • The Sandboxed File System is borking on symlinks. Again. HOT 5
  • SUPPORT page for CriticalComponentsAbsent Fatal Error HOT 36
  • Implement a Installment check for (yet) more bordelines use cases
  • Replace the need of the Kernel32.dll for Win64 rigs HOT 4
  • Workaround for `UnauthorizedAccessException ` in ` System.IO.Directory.GetDirectories` HOT 3
  • «The type initializer for ‘KSPe.1O.Hierarchy’ threw an exception.» HOT 2
  • Bug on `ConfigNodeWithSteroids.from`
  • Help with code refactoring HOT 15
  • Missing class: The type Initializer for ‘KSPe.IO.Hierarchy 1’ threw an exception error HOT 9
  • problem regarding KSPIE (interstellar extended) compatibility after 2.4.6.3 update HOT 14
  • The type initializer for ‘KSPe.1O.Hierarchy’ threw an exception — newest KspE and Lisias module manager. HOT 50
  • Mono’s Process.Process is leaking File Handlers when using `using` HOT 2
  • Use `RealPath` on everything that calls `System.IO`
  • TweakScale stopped working in Proton HOT 19
  • Implement Localizing on the Install Checker HOT 1
  • Append `KSPUtil.ApplicationRootPath` on internal pathnames before using. HOT 4
  • Dont get screwed by `System.IO.Directory.GetCurrentDirecrtory()` again. HOT 10
  • Fix the Installchecker for correctly explaining where to install things
Читайте также:  Qualcomm snapdragon 800 прошивка

Recommend Projects

React

A declarative, efficient, and flexible JavaScript library for building user interfaces.

Vue.js

🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

Typescript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

TensorFlow

An Open Source Machine Learning Framework for Everyone

Django

The Web framework for perfectionists with deadlines.

Laravel

A PHP framework for web artisans

Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

javascript

JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

Some thing interesting about web. New door for the world.

server

A server is a program made to process requests and deliver data to clients.

Machine learning

Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

Visualization

Some thing interesting about visualization, use data art

Some thing interesting about game, make everyone happy.

Recommend Org

Facebook

We are working to build community through open source technology. NB: members must have two-factor auth.

Microsoft

Open source projects and samples from Microsoft.

Источник

WinForms applications crash when a specific text is pasted into any control that can accept text. #18923

Comments

I just wanted to paste a piece text from Wikipedia in a Winforms application.

A similar bug reported in the xamarin bug tracker but no progress with it since 2017: https://xamarin.github.io/bugzilla-archives/60/60819/bug.html

Steps to Reproduce

  1. Paste following text into any RichTextControl, Textbox or anything that accepts pasted text: «Benzo[a]pyrene is a polycyclic aromatic hydrocarbon and the result of incomplete combustion of organic matter at temperatures between 300 °C (572 °F) and 600 °C (1,112 °F). The ubiquitous compound can be found in coal tar, tobacco smoke and many foods, especially grilled meats. » in a Winforms application. It even crashes if you paste into a file open dialog.

Apparently the issue is with the ° mark.

Current Behavior

Expected Behavior

It doesn’t crash and is able to handle the conversion (even if that means including a � instead.)

On which platforms did you notice this

[ ] macOS
[ X ] Linux
[ ] Windows

Version Used:

Mono JIT compiler version 6.8.0.105 (tarball Tue Feb 4 21:20:20 UTC 2020)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
Interpreter: yes
LLVM: yes(610)
Suspend: hybrid
GC: sgen (concurrent by default)

Stacktrace

The text was updated successfully, but these errors were encountered:

Источник

Smartadm.ru
Adblock
detector