Обсуждение: 65279 Invisible ASCII Character

Поиск
Список
Период
Сортировка

65279 Invisible ASCII Character

От
ramsiddu007
Дата:
Hi all,
      Today i got one problem what i have saved more that one procedures in a folder. After i have concatenate those files into single file through shell script. After am trying to run that single file in my server, it was showing syntax error. If i remove first character it's run. That first character is invisible, I have checked that ascii value, it is 65279.
How can i overcome this problem. I want to run my single file without this error. 

By below command i am concatenating individual scripting files to single. 
:> cat *.* > <file_name>.sql

select ascii('');

select chr(65279);

select length('');

Plz. give me suggestions, it's blocker to my work.


Thanking you,

--
Best Regards:
Ramanna Gunde

Re: 65279 Invisible ASCII Character

От
Christoph Moench-Tegeder
Дата:
## ramsiddu007 (ramsiddu007@gmail.com):

>  If i remove first character it's run. That first
> character is invisible, I have checked that *ascii* value, it is *65279*.

That's not an ASCII-value, ASCII has 8 bits at most.
What you've got there is a UTF-16 Byte Order Mark: 65279 is 0xfeff
(one of the well-known constants).
I'd suggest you get your editor configured to write files without
BOM. Maybe there's a workaround via locale settings - but I have
no machine with an UTF-16 locale available. Another approach is using
recode on your files before concatenating.

This question isn't really for pgsql-hackers - I'm redirecting to -general.

Regards,
Christoph

-- 
Spare Space


Re: 65279 Invisible ASCII Character

От
Christoph Moench-Tegeder
Дата:
## ramsiddu007 (ramsiddu007@gmail.com):

>  If i remove first character it's run. That first
> character is invisible, I have checked that *ascii* value, it is *65279*.

That's not an ASCII-value, ASCII has 8 bits at most.
What you've got there is a UTF-16 Byte Order Mark: 65279 is 0xfeff
(one of the well-known constants).
I'd suggest you get your editor configured to write files without
BOM. Maybe there's a workaround via locale settings - but I have
no machine with an UTF-16 locale available. Another approach is using
recode on your files before concatenating.

This question isn't really for pgsql-hackers - I'm redirecting to -general.

Regards,
Christoph

-- 
Spare Space