-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Write a shape file in Xamarin.forms bug #51
Comments
please post the complete code you're testing, from this I don't see why the line highlighted can throw a "ArgumentNullException" actually. No similar "throws" in the source code I suspect the error is in attributes dictionary... |
Posting images of your VisualStudio instance is not useful. |
string path; |
this code is working in application desktop c# but in Xamarin.forms not working, i don't know why ? |
I'm still missing a project file, the code you posted is just a function. Now, to get to where you are at, we do have to put in effort to set up a project that uses Xamairn.Forms, that eventually invokes your code. Please provide a minimum working sample project for us to test your code. |
thank you for find the code in this link |
this code works in .net, I made small changes
|
it still the problem ! even i separate the Header ! |
can you post the stack trace? can be helpful to investigate what is the method actually throwing the exception |
The cause for this to fail is probably the failure of the initialization of |
Please I need to know if there's a solution to read/write a shapefile in Xamarin.forms. I really appreciate your help. Thanks in advance. |
oh, understood. Maybe you can try to initialize the writer using an explicit Encoding as the third parameter and see if it works
BTW I'm trying to install Xamarin to do some tests... but it takes quite a time! Abd it's incredibly slow without Hyper-V acceleration (unavailable in my system...) |
@FObermaier
because RegisterEncodings stops recording all the other encodings after the first that fails, I think...
those are the missing encodings
@FObermaier if you agree I can push the fix direclty from my side, let me know |
@benabdelkrim you can do this to continue working
|
@DGuidi current implementation of /// <summary>
/// Utility function to get an encoding for the provided codepage identifier
/// </summary>
/// <param name="codePage">A code page identifier</param>
/// <returns> An <c>Encoding</c> or <c>null</c></returns>
public static Encoding GetEncodingForCodePageIdentifier(int codePage)
{
try { return CodePagesEncodingProvider.Instance.GetEncoding(codePage) ?? Encoding.GetEncoding(codePage); }
catch { return null; }
} gives much better results. No Encoding that can't be found. I changed the implementation of private static void RegisterEncodings(object[][] ldidCodePagePairs)
{
var validCodePages = new HashSet<int>(Encoding.GetEncodings().Select(t => t.CodePage));
foreach (object[] ldidCodePagePair in ldidCodePagePairs)
{
byte ldid = Convert.ToByte(ldidCodePagePair[0], CultureInfo.InvariantCulture);
int codePage = (int)ldidCodePagePair[1];
if (validCodePages.Contains(codePage))
AddLdidEncodingPair(ldid, Encoding.GetEncoding(codePage));
#if DEBUG
else
{
Debug.WriteLine("Failed to get Encoding for ldid={0} (Codepage {1})", ldid, codePage);
}
#endif
}
} Additionally I made the the unit tests pass, there were a lot failing... |
do you mean, they fails in android?
of course, thanks |
Hi all, On Android I have the same issue as the original issue describes.
Just wondering if there is any reason why it is not merged to the implementation? Thanks, |
Hi @benabdelkrim, do you need more support on this issue? If so, provide further details, please. |
The text was updated successfully, but these errors were encountered: