buglibiconv - Bugs: bug #28328, bug: \x5C conversion

 
 

bug #28328: bug: \x5C conversion

Submitted by:  None
Submitted on:  Fri 18 Dec 2009 04:13:28 AM UTC  
 
Category: EncodingsSeverity: 3 - Normal
Item Group: NoneStatus: Not a Bug
Privacy: PublicAssigned to: Bruno Haible <haible>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 19 Dec 2009 09:59:58 AM UTC, comment #1:

0x5C in UTF-8 and EUC-JP is the (half-width) REVERSE SOLIDUS.
This character is not present in the Shift_JIS character set.
Therefore it is normal and expected that the conversions fail.

Look at http://www.haible.de/bruno/charsets/conversion-tables/index.html
under Japanese -> Shift_JIS and extensions. There are many
encodings that are similar to Shift_JIS. The one used by
the many Windows systems in the world is CP932. Therefore,
nowadays, when people talk about Shift_JIS, they often mean
CP932, because they are not aware about the subtle differences.

Try
printf ab"\x5C"c | iconv -f utf-8 -t cp932
This succeeds.

Bruno Haible <haible>
Project AdministratorIn charge of this item.
Fri 18 Dec 2009 04:13:28 AM UTC, original submission:

bug: \x5C convertion
(iconv command has problem, shared liblary has no problem.)

printf ab"\x5C"c | iconv -f utf-8 -t eucjp
printf ab"\x5C"c | iconv -f utf-8 -t eucjp | iconv -f eucjp -t sjis

printf ab"\x5C"c | iconv -t eucjp -f sjis
printf ab"\x5C"c | iconv -t eucjp -f sjis | iconv -f eucjp -t sjis
printf ab"\x5C"c | iconv -f eucjp -t sjis

printf ab"\x5C"c | iconv -f utf-8 -t sjis

iconv --version
---------------------------------------
printf "\xE3\x81\x82\x5C\xEF\xBC\xA1" > utf8-jp-test.txt
iconv -f utf-8 -t sjis utf8-jp-test.txt
---------------------------------------

$ printf ab"\x5C"c | iconv -f utf-8 -t eucjp
ab\c
$ printf ab"\x5C"c | iconv -f utf-8 -t eucjp | iconv -f eucjp -t sjis
ab
iconv: (stdin):1:2: cannot convert

$ printf ab"\x5C"c | iconv -t eucjp -f sjis
ab\c
$ printf ab"\x5C"c | iconv -t eucjp -f sjis | iconv -f eucjp -t sjis
ab
iconv: (stdin):1:2: cannot convert
$ printf ab"\x5C"c | iconv -f eucjp -t sjis
ab
iconv: (stdin):1:2: cannot convert

$ printf ab"\x5C"c | iconv -f utf-8 -t sjis
ab
iconv: (stdin):1:2: cannot convert

$ iconv --version
iconv (GNU libiconv 1.13)

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by haible (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 24 Nov 2016 12:00:16 AM UTChaibleCategoryNone=>Encodings
    Sat 19 Dec 2009 10:00:23 AM UTChaibleSummarybug: \\x5C convertion=>bug: \x5C conversion
    Sat 19 Dec 2009 09:59:58 AM UTChaibleSummarybug: \\x5C convertion=>bug: \x5C convertion
    Sat 19 Dec 2009 09:59:57 AM UTChaibleOpen/ClosedOpen=>Closed
      Assigned toNone=>haible
      StatusNone=>Not a Bug

    Back to the top


    Powered by Savane 3.1-cleanup1