Results 1 to 5 of 5

Thread: sed with eight bit characters in input file

  1. #1
    Join Date
    Jun 2008
    Posts
    16

    Default sed with eight bit characters in input file

    I just remarked that using a sed script on a text file that contains at least one eight bit character does not work in Linux, but does on
    Solaris unix.
    e.g.: input file mytxt: contains
    Is this déj* vu for someone?

    mysedcmds: contains : s/ /_/g

    sed -f mysedcms mytxt
    replaces nothing
    but if mytxt contains "deja vu"
    then the replacments take place

    How to remedy this?

    (tried this on openSuSE and RedHat linux)

  2. #2
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: sed with eight bit characters in input file

    Works fine here.

    $ sed -f mysedcmds mytxt
    Is_this_dj_vu_for_someone?
    Deja_vu
    What version of OpenSUSE? Also do you have your locale set to UTF-8?

  3. #3
    Join Date
    Jun 2008
    Posts
    16

    Default Re: sed with eight bit characters in input file

    version 10.3.
    How do I set locale to UFT-8

  4. #4
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: sed with eight bit characters in input file

    For 11.0 /etc/sysconfig/language, variable RC_LANG=en_US.UTF-8 for example. Hopefully it's the same for 10.3.

  5. #5
    Join Date
    Sep 2008
    Location
    Germany Sachsen Anhalt Kreis Anhalt Bitterfeld
    Posts
    7

    Default Re: sed with eight bit characters in input file

    maybe u should install the utf-8 first and the try it again like ken_yap told it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •