unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* unicode support
@ 2014-03-31  5:18 Dima
  2014-03-31  8:19 ` support Игорь Гайсин
  0 siblings, 1 reply; 5+ messages in thread
From: Dima @ 2014-03-31  5:18 UTC (permalink / raw)
  To: guile-user

Hi.
   Did something change from guile 1.8.x to 2.0 with regards to unicode support.

I have a script that has strings written on russian without much care, and it does not work on 2.0.

I want to make sure whether there are changes in guile or something else.

Thanks, regards,
  Dima.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re:unicode support
  2014-03-31  5:18 unicode support Dima
@ 2014-03-31  8:19 ` Игорь Гайсин
  2014-03-31 12:36   ` unicode support Ludovic Courtès
  2014-03-31 21:41   ` Mark H Weaver
  0 siblings, 2 replies; 5+ messages in thread
From: Игорь Гайсин @ 2014-03-31  8:19 UTC (permalink / raw)
  To: Dima; +Cc: guile-user

Hi, dmitriy. Try to add this line to head your scripts

(setlocale LC_ALL "")
(set-port-encoding! (current-input-port) "utf-8")
(set-port-encoding! (current-output-port) "utf-8")


Dima <dima@minignu.minidns.net> writes:

> Hi.
>    Did something change from guile 1.8.x to 2.0 with regards to unicode support.
>
> I have a script that has strings written on russian without much care, and it does not work on 2.0.
>
> I want to make sure whether there are changes in guile or something else.
>
> Thanks, regards,
>   Dima.

-- 
Игорь Гайсин
Email: igor.gajsin@tts.tv
Телефон: 8-499-967-77-97 (4096)
Должность: Системный администратор ООО "Бриллианит"




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: unicode support
  2014-03-31  8:19 ` support Игорь Гайсин
@ 2014-03-31 12:36   ` Ludovic Courtès
  2014-03-31 21:41   ` Mark H Weaver
  1 sibling, 0 replies; 5+ messages in thread
From: Ludovic Courtès @ 2014-03-31 12:36 UTC (permalink / raw)
  To: guile-user

Игорь Гайсин <igor.gajsin@tts.tv> skribis:

> Hi, dmitriy. Try to add this line to head your scripts
>
> (setlocale LC_ALL "")
> (set-port-encoding! (current-input-port) "utf-8")
> (set-port-encoding! (current-output-port) "utf-8")

Also, note that by default the source file is expected to be
UTF-8-encoded.

You can use a different encoding, but then the file needs to contain a
‘coding:’ cookie (info "(guile) Character Encoding of Source Files").

Ludo’.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: unicode support
  2014-03-31  8:19 ` support Игорь Гайсин
  2014-03-31 12:36   ` unicode support Ludovic Courtès
@ 2014-03-31 21:41   ` Mark H Weaver
  2014-04-02  7:48     ` Nala Ginrut
  1 sibling, 1 reply; 5+ messages in thread
From: Mark H Weaver @ 2014-03-31 21:41 UTC (permalink / raw)
  To: Игорь Гайсин
  Cc: guile-user, Dima

Игорь Гайсин <igor.gajsin@tts.tv> writes:

> Hi, dmitriy. Try to add this line to head your scripts
>
> (setlocale LC_ALL "")
> (set-port-encoding! (current-input-port) "utf-8")
> (set-port-encoding! (current-output-port) "utf-8")

The 'setlocale' call is indeed important.

The next two lines shouldn't be needed, and would cause breakage on
non-utf8 locales.

     Regards,
       Mark


> Dima <dima@minignu.minidns.net> writes:
>
>> Hi.
>>    Did something change from guile 1.8.x to 2.0 with regards to unicode support.
>>
>> I have a script that has strings written on russian without much care, and it does not work on 2.0.
>>
>> I want to make sure whether there are changes in guile or something else.
>>
>> Thanks, regards,
>>   Dima.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: unicode support
  2014-03-31 21:41   ` Mark H Weaver
@ 2014-04-02  7:48     ` Nala Ginrut
  0 siblings, 0 replies; 5+ messages in thread
From: Nala Ginrut @ 2014-04-02  7:48 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: guile-user, Dima

On Mon, 2014-03-31 at 17:41 -0400, Mark H Weaver wrote:
> Игорь Гайсин <igor.gajsin@tts.tv> writes:
> 
> > Hi, dmitriy. Try to add this line to head your scripts
> >
> > (setlocale LC_ALL "")
> > (set-port-encoding! (current-input-port) "utf-8")
> > (set-port-encoding! (current-output-port) "utf-8")
> 
> The 'setlocale' call is indeed important.
> 

Yes, it is. And let me emphasize this again for any non latin-1 users.
Because it's so common that I was asked by others frequently.
My projects are heavily using CJK, so I always put it under shebang
lines to avoid "????" situation:
------------------------code-----------------------
#! /bin/env guile
!#
(setlocale LC_ALL "")
------------------------end------------------------
Don't forget this ;-)


> The next two lines shouldn't be needed, and would cause breakage on
> non-utf8 locales.
> 
>      Regards,
>        Mark
> 
> 
> > Dima <dima@minignu.minidns.net> writes:
> >
> >> Hi.
> >>    Did something change from guile 1.8.x to 2.0 with regards to unicode support.
> >>
> >> I have a script that has strings written on russian without much care, and it does not work on 2.0.
> >>
> >> I want to make sure whether there are changes in guile or something else.
> >>
> >> Thanks, regards,
> >>   Dima.
> 





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-04-02  7:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-31  5:18 unicode support Dima
2014-03-31  8:19 ` support Игорь Гайсин
2014-03-31 12:36   ` unicode support Ludovic Courtès
2014-03-31 21:41   ` Mark H Weaver
2014-04-02  7:48     ` Nala Ginrut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).