Questions tagged [shift-jis]

Shift JIS is a character encoding for the Japanese language

108 questions
0
votes
2 answers

python file writing shows the error for UnicodeEncodeError

I need to make the cp932 (it is expanded shift-jis) UnicodeEncodeError: 'cp932' codec can't encode character '\u270c' in position 0: illegal multibyte sequence import codecs mytext = '\u270c' with…
whitebear
  • 11,200
  • 24
  • 114
  • 237
0
votes
0 answers

Reading failure from Shift-JIS text with fwscanf() in C

I am trying to read a text file in Shift-JIS encoding with fwscanf() in C, like this: _locale_t JapaneseLocale=_create_locale(LC_ALL, "ja_JP"); FILE *inoto,*outoto; double oto[LineCount][5]; int CurrentReading=0 wchar_t…
SuibianP
  • 99
  • 1
  • 11
0
votes
2 answers

IE11 iframe cached content has wrong encoding

I've got a webpage which dynamically embeds an iframe, which loads a JS file containing localization strings: the outer page has a content type of "Shift-JIS", but the inner frame (and the localization strings) are "utf-8". The structure is…
0
votes
1 answer

Cannot cat shift-jis file in mac terminal

I have a file that emacs correctly displays on mac. When I cat or less the file in mac terminal I see garbled characters such as "?E?u?@?@?@?@?@?@?@?". Running chardetect indicates SHIFT-JIS. I tried adding the following to ~./bashrc but still see…
user11020868
  • 405
  • 1
  • 5
  • 11
0
votes
2 answers

Convert UTF-8 to Shift-JIS

I have written the simple conversion code to convert to Japanese character from UTF-8. private static String convertUTF8ToShiftJ(String uft8Strg) { String shftJStrg = null; try { byte[] b = uft8Strg.getBytes(UTF_8); …
CabNt
  • 31
  • 1
  • 1
  • 9
0
votes
1 answer

Encoding issue with Japanese text in HTML

I am working with an old Japanese Website Project. I download the old files from the server and it's working fine in offline mode with browser. But when I open it with editor the text is broken. Then I try to fix this problem by changing the…
devzakir
  • 387
  • 3
  • 15
0
votes
2 answers

Garbled japanese title in html - SHIFT JIS

In my html code , where i use japanese signs - title ( only title ) is garbled . It's only in japanese environment (OS) . Title shows as something like : �����i�A� . Body shows japanese signs . I tried to set attributes like 'lang' but it doesn't…
user9710033
0
votes
1 answer

Use iconv API in C

I try to convert a sjis string to utf-8 using the iconv API. I compiled it already succesfully, but the output isn't what I expected. My code: void convertUtf8ToSjis(char* utf8, char* sjis){ iconv_t icd; int index = 0; char *p_src, *p_dst; …
Constantin
  • 8,721
  • 13
  • 75
  • 126
0
votes
1 answer

Python 3: my unicode2shift-jis script works except writes ASCII file. Why?

I have a file with Unicode Japanese writing in it and I want to convert it to Shift-JIS and print it out to Shift-JIS encoded file. I do this: with open("unikanji.txt", 'rb') as unikanjif: unikanji = unikanjif.read() sjskanji =…
0
votes
3 answers

Convert Shift_JIS format to UTF-8 format

I am trying to convert a Shift_JIS formatted file into UTF-8 format. For this, below is my approach: Read Shift_JIS file getBytes of each line and convert it to UTF-8 Create new file and write UTF-8 converted value to it Issue is that at step 2…
Vikasdeep Singh
  • 20,983
  • 15
  • 78
  • 104
0
votes
3 answers

Java write Shift-JIS CSV format file

I am currently doing some testing with the output CSV file for Shift-JIS format, but somehow i found it weird on the trials of differences japanese characters as below : My code : try { String dat2 = "カヨ ハラダ"; String dat =…
crchin
  • 9,473
  • 6
  • 22
  • 28
0
votes
1 answer

WideCharToMultiByte - required size and bytes written are different for Shift-JIS codepage

I've got a Unicode string containing four Japanese characters and I'm using WideCharToMultiByte to convert it to a multi-byte string specifying the Shift-JIS codepage of 932. In order to get the size of the required buffer I'm calling…
nblackburn
  • 338
  • 2
  • 10
0
votes
1 answer

TextOut() and Shift-JIS (Japanese characters)

I have a program in which I have been printing normal ASCII strings on screen using TextOut(). I now want to add the capability of printing out Shift-JIS encoded strings. Can I somehow tell TextOut() that I want to print a Shift-JIS string or do I…
Mick
  • 8,284
  • 22
  • 81
  • 173
0
votes
2 answers

Get character code of specific encoding from string

I'm trying to get the shift-jis character code from a unicode string. I'm not really that knowledgable in python, but here is what I have tried so far: #!/usr/bin/env python # -*- coding: utf-8 -*- from struct import…
sollniss
  • 1,895
  • 2
  • 19
  • 36
0
votes
2 answers

EUC-JP or GB18030 Text File

I have a text file with the following contents in it: Ã(195) Ü(220) Â(195) ë(235) Ó(211) Ã(195) »(187) §(167) Ã(195) û(251) Ã(195) Ü(220) Â(194) ë(235) Ã(195) û(251) ³(179) Æ(198) Ã(195) û(251) ³(179) Æ(198). For simplicity, along with the text I…
learn_develop
  • 1,735
  • 4
  • 15
  • 33