Release build only: CodePage 1252 not supported


I just bought your component from the Xamarin Studio Component Store on OSX, and I got it integrated into my app pretty quickly. It works great when I publish a Debug build, but when I run a Release build, I'm getting the following error:

[MonoDroid] UNHANDLED EXCEPTION: System.NotSupportedException: CodePage 1252 not supported
[MonoDroid] at System.Text.Encoding.GetEncoding (int) <0x002f0>
[MonoDroid] at FlexCel.Core.MvxSetupState.GetRunning (int) <0x00013>
[MonoDroid] at FlexCel.XlsAdapter.Unbound.KeyFrame (FlexCel.XlsAdapter.CaseInputModel) <0x00213>
[MonoDroid] at FlexCel.XlsAdapter.Unbound.TestUpload (FlexCel.XlsAdapter.CaseInputModel) <0x0003f>
[MonoDroid] at FlexCel.XlsAdapter.XlsFile.IsManaged (bool) <0x00183>
[MonoDroid] at FlexCel.XlsAdapter.XlsFile.TryRead (FlexCel.Core.TPropertyId) <0x0004b>
[MonoDroid] at FlexCel.XlsAdapter.EofReached.FinilizeStatus (FlexCel.Core.ExcelFile) <0x0003f>
[MonoDroid] at FlexCel.XlsAdapter.XlsFile.QueryFormatter (FlexCel.Core.TPropertyId,string) <0x0003b>
[MonoDroid] at FlexCel.Core.TDocumentProperties.SetStandardProperty (FlexCel.Core.TPropertyId,string) <0x00033>
[MonoDroid] at StableLab.HorseActivity.CreateXlsFile (FlexCel.Core.ExcelFile,StableLab.Core.Horse) <0x04b83>
[MonoDroid] at StableLab.HorseActivity/<SetupExport>c__AnonStorey1.<>m__2 (object,System.EventArgs) <0x0015b>
[MonoDroid] at Android.Views.View/IOnClickListenerImplementor.OnClick (Android.Views.View) <0x00047>
[MonoDroid] at Android.Views.View/IOnClickListenerInvoker.n_OnClick_Landroid_view_View_ (intptr,intptr,intptr) <0x0005f>
[MonoDroid] at (wrapper dynamic-method) object.0337682b-44ab-492f-991e-6c4d2e325516 (intptr,intptr,intptr) <0x00043>
[mono-rt] [ERROR] FATAL UNHANDLED EXCEPTION: System.NotSupportedException: CodePage 1252 not supported
[mono-rt]   at System.Text.Encoding.GetEncoding (Int32 codepage) [0x00000] in <filename unknown>:0
[mono-rt]   at FlexCel.Core.MvxSetupState.GetRunning (Int32 Values4) [0x00000] in <filename unknown>:0
[mono-rt]   at FlexCel.XlsAdapter.Unbound.KeyFrame (FlexCel.XlsAdapter.CaseInputModel PaddingLeft) [0x00000] in <filename unknown>:0
[mono-rt]   at FlexCel.XlsAdapter.Unbound.TestUpload (FlexCel.XlsAdapter.CaseInputModel CurrentLocale) [0x00000] in <filename unknown>:0
[mono-rt]   at FlexCel.XlsAdapter.XlsFile.IsManaged (Boolean PrimaryAddress) [0x00000] in <filename unknown>:0
[mono-rt]   at FlexCel.XlsAdapter.XlsFile.TryRead (TPropertyId DefaultWidth) [0x00000] in <filename unknown>:0
[mono-rt]   at FlexCel.XlsAdapter.EofReached.FinilizeStatus (FlexCel.Core.ExcelFile ExecutingJobs) [0x00000] in <filename unknown>:0
[mono-rt]   at FlexCel.XlsAdapter.XlsFile.QueryFormatter (TPropertyId VisualTop, System.String NamedProperty) [0x00000] in <filename unknown>:0
[mono-rt]   at FlexCel.Core.TDocumentProp

Is there something I have to configure to make this work in Release mode?


Kevin N.

P.S. I tried to submit this to the direct support form, but it told me I hadn't filled out all the fields, even though I had. Please fix! (I bought through Xamarin Component Store, and it left my account with an empty name field - maybe that has something to do with it?)


Can it be that you added encodings to debug, but not to release?  While we try to reduce the use of 1252 codepage, sometimes it is needed, so the best is to add it to your app.

I am in the middle of a webinar right now and I can't expand much, but you can read aout how to add encodings here:

(take a look at "0 - before getitng started") 

I'm not adding any special debugging or anything, it's the same code for both debug and release builds. I created a giant output script using ApiMate, and then just edited that down until it worked.

Try adding the encodings:

Right click the project, choose "Options"
Go to Build->Android Build and select the "Linker" tab. There in the "Internationalization" section choose "west".

But make sure to select "release" in the top of the screen, or you will only add the encoding for debug (which is what I guess happened here).

Next FlexCel release won't need this step for simple files, but it will still need them in some cases. So the best to be safe is to add those encodings to your app.

It worked!! Your Support level is over 9000!