Author | Topic: Prevent automatic OEM-ANSI conversion | |
---|---|---|
Damir Hodak | Prevent automatic OEM-ANSI conversion on Mon, 23 Sep 2019 21:11:10 +0200 Hi all! I have a problem working with ActiveX objects. I have to send binary data to ActiveX object. I send binary data as character strings, but Xbase internaly make automatic OEM-ANSI conversion of all strings. Does anybody have any suggestion? I am using Alaska Xbase 1.90.355 SL1 in VIO mode. Regards Damir | |
Thomas Braun | Re: Prevent automatic OEM-ANSI conversion on Tue, 24 Sep 2019 08:35:43 +0200 Damir Hodak wrote: > I send binary data as character strings, but Xbase internaly make automatic > OEM-ANSI conversion of all strings. Normally, his only affects DBF database access. Are you storing those strings in DBF files? If yes, you need to switch to FOXDBE and create those fields as binary character or varchar fields (Field type X or Z > I am using Alaska Xbase 1.90.355 SL1 in VIO mode. I would also suggest to upgrade to Xbase++ 2.x hth Thomas | |
Damir Hodak | Re: Prevent automatic OEM-ANSI conversion on Tue, 24 Sep 2019 20:51:12 +0200 On Tue, 24 Sep 2019 08:35:43 +0200, Thomas Braun wrote: > Damir Hodak wrote: > > >> I send binary data as character strings, but Xbase internaly make automatic >> OEM-ANSI conversion of all strings. > > Normally, his only affects DBF database access. > > Are you storing those strings in DBF files? > > If yes, you need to switch to FOXDBE and create those fields as binary > character or varchar fields (Field type X or Z > >> I am using Alaska Xbase 1.90.355 SL1 in VIO mode. > > I would also suggest to upgrade to Xbase++ 2.x > > hth > Thomas Hi Thomas! I am not storing those strings in DBF files. I am sending those strings to ActiveX object. For example, I send UTF-8 encoded string to MSXML2.XMLHTTP ActiveX object. Regards Damir | |
Jim Lee | Re: Prevent automatic OEM-ANSI conversion on Tue, 24 Sep 2019 09:35:37 +0200 hi, > I send binary data as character strings, but Xbase internaly make > automatic > OEM-ANSI conversion of all strings. did you talk about Bitmap as binary data ? --- Diese E-Mail wurde von AVG auf Viren geprüft. http://www.avg.com | |
Damir Hodak | Re: Prevent automatic OEM-ANSI conversion on Tue, 24 Sep 2019 20:52:30 +0200 On Tue, 24 Sep 2019 09:35:37 +0200, Jim Lee wrote: > hi, > >> I send binary data as character strings, but Xbase internaly make >> automatic >> OEM-ANSI conversion of all strings. > > did you talk about Bitmap as binary data ? > > > > --- > Diese E-Mail wurde von AVG auf Viren geprüft. > http://www.avg.com Hi Jim! I am talking generally, about any binary data. Regards Damir | |
Andreas Gehrs-Pahl | Re: Prevent automatic OEM-ANSI conversion on Wed, 25 Sep 2019 22:27:26 -0400 Damir, >I have a problem working with ActiveX objects. >I have to send binary data to ActiveX object. >I send binary data as character strings, but Xbase internaly make automatic >OEM-ANSI conversion of all strings. Xbase++ only does implicit (automatic) OEM/ANSI conversions when data is displayed or saved-to / read-from database files, and only if the current CharSet isn't matching the target/source. There is no other implicit data conversion. Simply sending data to an Active-X object will not invoke any implicit character conversions. If the problem is really implicit OEM/ANSI conversion by the Xbase++ runtime (and I'm not sure that this is the case here), then the solution is quite simple. Use the following code pattern to prevent implicit conversions: Set CharSet to ANSI assuming that your normal setting is OEM cBinary := "whatever" oXMLHTTPRequest:Open(...) oXMLHTTPRequest:Send(...) ... Set CharSet to OEM assuming that your normal setting is OEM It might be better, though, if you could post a small demo program that shows the problem. Especially how you create the UTF-8 encoded string and how you send it. That would make it much easier to give you some actual help, rather than wild guesses on out part. Andreas Andreas Gehrs-Pahl Absolute Software, LLC phone: (989) 723-9927 email: Andreas@AbsoluteSoftwareLLC.com web: http://www.AbsoluteSoftwareLLC.com [F]: https://www.facebook.com/AbsoluteSoftwareLLC | |
Damir Hodak | Re: Prevent automatic OEM-ANSI conversion on Fri, 27 Sep 2019 10:35:46 +0200 On Wed, 25 Sep 2019 22:27:26 -0400, Andreas Gehrs-Pahl wrote: > Damir, > >>I have a problem working with ActiveX objects. >>I have to send binary data to ActiveX object. >>I send binary data as character strings, but Xbase internaly make automatic >>OEM-ANSI conversion of all strings. > > Xbase++ only does implicit (automatic) OEM/ANSI conversions when data is > displayed or saved-to / read-from database files, and only if the current > CharSet isn't matching the target/source. There is no other implicit data > conversion. Simply sending data to an Active-X object will not invoke any > implicit character conversions. > > If the problem is really implicit OEM/ANSI conversion by the Xbase++ runtime > (and I'm not sure that this is the case here), then the solution is quite > simple. Use the following code pattern to prevent implicit conversions: > > Set CharSet to ANSI assuming that your normal setting is OEM > cBinary := "whatever" > oXMLHTTPRequest:Open(...) > oXMLHTTPRequest:Send(...) > ... > Set CharSet to OEM assuming that your normal setting is OEM > > It might be better, though, if you could post a small demo program that > shows the problem. Especially how you create the UTF-8 encoded string and > how you send it. That would make it much easier to give you some actual > help, rather than wild guesses on out part. > > Andreas Hi Andreas! Thank you for your suggestion. I tried changing CharSet, but it didn't work. Right now I do not have a time to assemble small demo, but I'll post it as soon as I do it. Regards Damir |