Re: O$ 10.1: Single quote (inverted coma) converts to ’ when importing a comma delimited file into a list

Doug Easterbrook doug at artsman.com
Tue Mar 22 20:20:27 UTC 2022


hi Asif

so, then if I understand you a little differently, you want those characters imported — and as UTF8? into a UTF8 text string?


I took your initial question as you didn’t want them as they are kind of the bane of my existence when importing from tab delimited files to insert into an omnis data file.

if you look at the documentation, you can use FileOps.$readcharacter() with an encoding of your choice.  I believe it looks at the BOM marker on the file (the first few bytes indicate what the file encoding is) as it does its conversion.


https://www.omnis.net/developers/resources/onlinedocs/Programming/13unicode.html#fileops



I know that for our own exports of files, we’ve told omnis to leave out the BOM marker on files using the following … since most of our clients are north American and they rarely have UTF8 characters in their data.

Calculate $root.$prefs.$exportbom as kfalse

Calculate $root.$prefs.$importencoding as kUniTypeUTF8

so you might look at your preferences to see what those are and see if it makes a difference


Doug Easterbrook
Arts Management Systems Ltd.
mailto:doug at artsman.com
http://www.artsman.com
Phone (403) 650-1978

> On March 22, 2022, at 9:12 AM, Asif Jabbar <asifj at sanmar.com> wrote:
> 
> Hi Doug,
> 
> Correct it is a UTF-8 character single quote.  So if I read you suggestions correctly: do it pre or post import - there’s nothing in the Import command itself which can keep the  UTF-8 char and not convert it to ’ (because that’s where the conversion is happening?
> 
> Thank you - 
> 
>> On Mar 22, 2022, at 12:58 AM, Doug Easterbrook via omnisdev-en <omnisdev-en at lists.omnis-dev.com <mailto:omnisdev-en at lists.omnis-dev.com>> wrote:
>> 
>> EXTERNAL EMAIL: Do not click any links or open any attachments unless you trust the sender and know the content is safe.
>> 
>> hi Asif.
>> 
>> It likely isn’t a single quote.    
>> 
>> It is more likely to be a single curly quote (or some other such UTF8 character), which means you many need to either pre-process the file and remove/replace those.
>> 
>> or do it as part of your import process.
>> 
>> 
>> 
>> 
>> 
>> Doug Easterbrook
>> Arts Management Systems Ltd.
>> mailto:doug at artsman.com <mailto:doug at artsman.com>
>> http://www.artsman.com <http://www.artsman.com/>
>> Phone (403) 650-1978
>> 
>>> On March 21, 2022, at 10:48 AM, Asif Jabbar <asifj at sanmar.com <mailto:asifj at sanmar.com>> wrote:
>>> 
>>> Hi List,
>>> 
>>> Did lots of research (Omnis and general) but didn’t see a way to prevent a single quote converting to  ’ when importing a comma delimited file into a list.
>>> 
>>> Is there a way to enforce the non-conversion when using Import from File command?
>>> 
>>> Thanks as always for any help,
>>> 
>>> Asif Jabbar
>>> _____________________________________________________________
>>> Manage your list subscriptions at https://lists.omnis-dev.com <https://lists.omnis-dev.com/>
>>> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com <mailto:omnisdev-en at lists.omnis-dev.com> 
>> 
>> _____________________________________________________________
>> Manage your list subscriptions at https://lists.omnis-dev.com <https://lists.omnis-dev.com/>
>> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com <mailto:omnisdev-en at lists.omnis-dev.com>



More information about the omnisdev-en mailing list