Additional/special characters when streaming blobs in/out

Rob_Hansen
Member Posts: 296
Has anyone encountered issues with NAV adding extra (special / non-standard) characters at the start of text streamed in/out of BLOB fields? I'm doing work in NAV 2013 streaming out of BLOBs to text files and then streaming them back in (after the user makes changes) and one or two extra characters are appearing at the start of the files. It's somewhat random as it doesn't happen every time. I've also had strange cases where spaces are inserted between each character without explanation (on the first run, the extra spaces show up...on the next run, they don't...with the same code).
Has anyone encountered any issues along those lines with text streams? I've tried using both COPYSTREAM, as well as manually reading/writing each character out, with the same results.
Has anyone encountered any issues along those lines with text streams? I've tried using both COPYSTREAM, as well as manually reading/writing each character out, with the same results.
Rob Hansen
http://www.epimatic.com
http://www.epimatic.com
0
Comments
-
The file that you are importing is probably in different encoding. It could be in unicode UTF8 or UTF16.
Take a look at this post on how to import the files.
http://blogs.msdn.com/b/nav/archive/201 ... gle+Reader0 -
These are files that are initially created by NAV where i'm writing out the content. When the BLOB is initially empty, i'm creating an empty text file and opening it with notepad for the user to edit. Then when the user closes notepad I open the file and stream it back into the blob. I've tried multiple different approaches here...directly using COPYSTREAM, using OStream.WRITE to transfer it character by character, and transferring it to text variables first and then reading/writing. The extra characters still show up, but as I said it's not every time. Sometimes when I stream out the text, it even adds a space between every character.
This one's driving me nuts...I guess i'll go to Microsoft with it as it seems buggy.Rob Hansen
http://www.epimatic.com0 -
This one's interesting. I switched my code to use the .net StreamWriter, set to ASCII encoding...and it works without any extra/special characters. The only change I made in my code was to switch the line that previously used the Write method of the NAV outstream object to instead use the .net object write method...and everything works great.
Has anyone else had issues with the NAV outstream and extra characters showing up?
(I'm still using the NAV instream for the read side, and i'm still creating a NAV outstream...i'm just now using the streamwriter Write function instead of OStream.Write)Rob Hansen
http://www.epimatic.com0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions