Page 1 of 1

Ascii Quote Fun and Games

Posted: Tue Feb 05, 2019 3:02 pm
by jim wood
Guys,

I'm trying to move awkward data between cubes and this includes free comment fields. The fields contain all kinds of crap so I can't use the usual delimiters as I'm exporting it to file first. I have therefore gone for the Ascii quote character set as Char(186) which then looks like this:
Quote.PNG
Quote.PNG (329 Bytes) Viewed 4695 times
The process exports the data to file as expected without issue. The same process then loads the data in to the other cube. The problem is that the process doesn't seem to like the quote character. I get the following errors:
QuoteError.PNG
QuoteError.PNG (3 KiB) Viewed 4695 times
I have made sure that the source ascii quote is set correctly yet the process still doesn't seem to like it.

Any idea why guys?

Jim.

Re: Ascii Quote Fun and Games

Posted: Tue Feb 05, 2019 3:37 pm
by jim wood
Looks like it may have something to do with the extended Ascii character set. Looking at something else and will post back.

Re: Ascii Quote Fun and Games

Posted: Tue Feb 05, 2019 3:58 pm
by jim wood
It was 100% because I was using an extended Ascii character 0186. Once I lowered it to character 94 everything worked as expected. It's interesting that the process itself recognized the extended character but the data tab part of the process did not,

Jim.

Re: Ascii Quote Fun and Games

Posted: Tue Feb 05, 2019 4:39 pm
by Wim Gielis
I have seen strange cases in the past with extended Ascii characters and try to stay away from there.
Which includes French accents like é, è, ê too. Not sure if this is still an issue nowadays, I am talking about some 5 years ago.

Re: Ascii Quote Fun and Games

Posted: Tue Feb 05, 2019 5:24 pm
by jim wood
Wim Gielis wrote: Tue Feb 05, 2019 4:39 pm I have seen strange cases in the past with extended Ascii characters and try to stay away from there.
Which includes French accents like é, è, ê too. Not sure if this is still an issue nowadays, I am talking about some 5 years ago.
We're still on 10.2.2 so it may have been fixed since.

Re: Ascii Quote Fun and Games

Posted: Tue Feb 05, 2019 8:29 pm
by paulsimon
Hi Jim

You may already be doing this, but in the past when I had to write different languages (including chinese) to files and read them back, I did the following :

In the Prolog get the char set

Code: Select all

vCharSet =  CellGetS( vInfoCube, 'Any', 'Character Set' ) ;
When writing to a file in the Data Tab you need something that will track the very first record being written :

Code: Select all

IF( vDataRecCount = 1 ) ;

  # Before outputting anything to the main file, 
  # we need to set the character set immediately before
  # the first output statement.

  SetOutputCharacterSet( vPathFile , vCharSet ) ;
  textoutput( vPathFile , 'Element' , 'Attr'  , 'OldVal' , 'NewVal' ) ;

ENDIF;

When reading from a file in the Prolog you need something like

Code: Select all

SetInputCharacterSet( vCharSet ) ;
Regards

Paul Simon

Re: Ascii Quote Fun and Games

Posted: Wed Feb 06, 2019 3:07 am
by Andy Key
If you're only writing the data out to a file so you can read it back in again, won't SetOutputEscapeDoubleQuote cover it? No need to use anything other than the standard double quote, although you can still choose something else if you want, it will double up whatever character you have as the ASCIIQuoteCharacter.

You're still stuck with the joys of things like embedded CR/LF though...