Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'SJIS' encoding format not in locale_encodings[] list #1819

Closed
michaelrsweet opened this issue Jul 4, 2006 · 5 comments
Closed

'SJIS' encoding format not in locale_encodings[] list #1819

michaelrsweet opened this issue Jul 4, 2006 · 5 comments
Milestone

Comments

@michaelrsweet
Copy link
Collaborator

Version: 1.2.1
CUPS.org User: twaugh.redhat

Original bug report:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=197577

The SJIS encoding format does not appear in the locale_encodings[] array in cups/language.c.

This causes jobs submitted from LC_CTYPE=ja_JP.SJIS locales not to be interpreted correctly.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Hmm, sjis isn't an ISO-registered name (windows-932 is, and IIRC corresponds to Shift-JIS). Will need to add some special cases for this...

WRT passing alternate encodings from the locale, you can use:

lp -o document-charset=windows-932 ...

to tell CUPS that the text file uses a different encoding.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: twaugh.redhat

'document-charset'? I couldn't see that described anywhere, only 'document-format'.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

document-charset is documented in the IPP spec. Since it is rarely used (and then only for text files which normally have the locale's encoding), we don't document it separately right now... Feel free to file a RFE for this...

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Fixed in Subversion repository.

@michaelrsweet
Copy link
Collaborator Author

"str1819.patch":

Index: language.c

--- language.c (revision 5743)
+++ language.c (working copy)
@@ -560,6 +560,23 @@
encoding = (cups_encoding_t)i;
break;
}
+

  • if (encoding == CUPS_AUTO_ENCODING)
  • {
  • /*
    
  •  \* Map alternate names for various character sets...
    
  •  */
    
  •  if (!strcasecmp(charset, "iso-2022-jp") ||
    
  •      !strcasecmp(charset, "sjis"))
    
  • encoding = CUPS_WINDOWS_932;
  •  else if (!strcasecmp(charset, "iso-2022-cn"))
    
  • encoding = CUPS_WINDOWS_936;
  •  else if (!strcasecmp(charset, "iso-2022-kr"))
    
  • encoding = CUPS_WINDOWS_949;
  •  else if (!strcasecmp(charset, "big5"))
    
  • encoding = CUPS_WINDOWS_950;
  • }
    }

DEBUG_printf(("cupsLangGet: encoding=%d(%s)\n", encoding,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant