Page 1 of 1

Locales in Solaris 11

Posted: Tue Apr 30, 2013 8:05 pm
by cah
Lately, I am trying to slowly move from BIG-5 encoding to UTF-8 due to the gaining adoption of UTF-8.

On Solaris 11 server, I have locale "C" set as default.
With that setting, all Chinese characters sent out via email is encoded as BIG-5 (don't know why).
I can't seem to be able to change it to UTF-8.

The other thing is, the MySQL DB also has BIG-5 as the default encoding.
I may also need to try to convert from BIG-5 to UTF-8.

In the meantime, there is a command to convert from BIG-5 to UTF-8:

Code: Select all

iconv -f big5 -t UTF-8 inputfilename > outputfilename
I tested it out and it worked.

Code Set Conversion in Solaris 11

Posted: Wed May 01, 2013 1:43 pm
by cah
http://docs.oracle.com/cd/E23824_01/htm ... #scrolltoc

Installing developer/icu package for "uconv" Utility:

Code: Select all

cahtoh02:/export/home/cah%pkg install developer/icu 
           Packages to install:  2
       Create boot environment: No
Create backup boot environment: No

DOWNLOAD                                  PKGS       FILES    XFER (MB)
Completed                                  2/2     253/253    15.3/15.3$<3>

PHASE                                        ACTIONS
Install Phase                                340/340 

PHASE                                          ITEMS
Package State Update Phase                       2/2 
Image State Update Phase                         2/2 

PHASE                                          ITEMS
Reading Existing Index                           8/8 
Indexing Packages                                2/2
Displaying package information:

Code: Select all

cahtoh02:/export/home/cah%pkg info developer/icu   
          Name: developer/icu
       Summary: International Components for Unicode (development files)
   Description: ICU is a set of C and C++ libraries that provides robust and
                full-featured Unicode and locale support. The library provides
                calendar support, conversions for many character sets, language
                sensitive collation, date and time formatting, support for many
                locales, message catalogs and resources, message formatting,
                normalization, number and currency formatting, time zones
                support, transliteration, word, line and sentence breaking, etc.
                This package contains development files and utilities.
      Category: System/Internationalization
         State: Installed
     Publisher: solaris
       Version: 0.5.11
 Build Release: 5.11
        Branch: 0.175.0.0.0.1.765
Packaging Date: Wed Oct 12 04:40:18 2011
          Size: 4.77 MB
          FMRI: pkg://solaris/developer/icu@0.5.11,5.11-0.175.0.0.0.1.765:20111012T044018Z
Installing storage/fsexam package for File Examiner (fsexam):

Code: Select all

cahtoh02:/export/home/cah%pkg install storage/fsexam            
           Packages to install:  3
       Create boot environment: No
Create backup boot environment: No
            Services to change:  2

DOWNLOAD                                  PKGS       FILES    XFER (MB)
Completed                                  3/3   2634/2634    54.4/54.4$<3>

PHASE                                        ACTIONS
Install Phase                              2868/2868 

PHASE                                          ITEMS
Package State Update Phase                       3/3 
Image State Update Phase                         2/2 

PHASE                                          ITEMS
Reading Existing Index                           8/8 
Indexing Packages                                3/3
Displaying package information:

Code: Select all

cahtoh02:/export/home/cah%pkg info storage/fsexam   
          Name: storage/fsexam
       Summary: Filesystem Examiner
   Description: File System Examiner is to help user migrate file name and file
                content from legacy encoding to UTF8 encoding.
      Category: Applications/System Utilities
         State: Installed
     Publisher: solaris
       Version: 0.8.3
 Build Release: 5.11
        Branch: 0.175.0.0.0.0.0
Packaging Date: Tue Sep 27 11:38:02 2011
          Size: 2.26 MB
          FMRI: pkg://solaris/storage/fsexam@0.8.3,5.11-0.175.0.0.0.0.0:20110927T113802Z
Installing text/auto_ef package for Auto Encoding Finder (auto_ef):

Code: Select all

cahtoh02:/export/home/cah%pkg install text/auto_ef  
No updates necessary for this image.
Displaying package information:

Code: Select all

cahtoh02:/export/home/cah%pkg info text/auto_ef   
          Name: text/auto_ef
       Summary: Auto encoding finder (auto_ef)
   Description: Auto encoding finder
      Category: System/Text Tools
         State: Installed
     Publisher: solaris
       Version: 0.5.11
 Build Release: 5.11
        Branch: 0.175.0.0.0.1.765
Packaging Date: Wed Oct 12 10:24:35 2011
          Size: 5.48 MB
          FMRI: pkg://solaris/text/auto_ef@0.5.11,5.11-0.175.0.0.0.1.765:20111012T102435Z
This is strange because I was unable to find auto_ef before the installation.

Code: Select all

/export/home/cah%type auto_ef
-ksh: whence: auto_ef: not found
After the package install, I was able to find it.

Code: Select all

/export/home/cah%type auto_ef
auto_ef is a tracked alias for /usr/bin/auto_ef

Code: Select all

/export/home/cah%ls -l /usr/bin/auto_ef
-r-xr-xr-x   1 root     bin        12756 May  1 13:26 /usr/bin/auto_ef
Time stamp showed it was installed by the package installation.....

Anyhow, with auto_ef, I was able to figure out what encoding is for the attached file:

Code: Select all

/export/home/cah%auto_ef test
UTF-8
/export/home/cah%auto_ef -a test
UTF-8  1.00
test.doc
Encoding test file (due to limitation on phpbb, I have to rename the file to have doc extension before it takes it.....)
(26 Bytes) Downloaded 374 times

International Language Environments Guide

Posted: Wed May 01, 2013 1:54 pm
by cah