Shift JIS is a character encoding for the Japanese language
Questions tagged [shift-jis]
108 questions
3
votes
2 answers
shift jis decoding/encoding in perl
When I try decode a shift-jis encoded string and encode it back, some of the characters get garbled:
I have following code:
use Encode qw(decode encode);
$val=;
print "\nbefore decoding: $val";
my $ustr = Encode::decode("shiftjis",$val);
print…

Sushant
- 379
- 3
- 14
3
votes
1 answer
Why does Android Shift-JIS encoding of Yen (U+00A5) symbol produce -4,-4 ?
Running the following code seems to generate the wrong values:
byte[] data = "\u00a5".getBytes("Shift_JIS");
It produces [ -4, -4 ], but I expect [ 0x5c ]
I've tried various alternative names, "Shift-JIS", "shift_jis", "cp932" and all produce the…

StephenD
- 3,662
- 1
- 19
- 28
3
votes
0 answers
Open a SHIFT_JIS file in Ruby 1.8.7
This is one of those things that seems like it should be laughably easy but I'm stuck...
I need to open a CSV file that is stored in SHIFT_JIS encoding and decode it to Unicode and also encode in UTF-8. It sounds like this is pretty straightforward…

Scott
- 61
- 5
2
votes
1 answer
How can I encode/decode shift-jis in elixir?
Given text in shift-jis encoding, how can I decode it into Elixir's native UTF-8 encoding, and vice-versa?

Adam Millerchip
- 20,844
- 5
- 51
- 74
2
votes
1 answer
How to trim whitespaces from Japanese characters while loading data into DB through SQL Loader?
I want to load records into Oracle database through SQL Loader. Everything is working fine except for the Japanese characters are not being trimmed and whitespaces are inserted into the DB. Due to this issue, I have to use StringUtils.stripToEmpty()…

Vipul Kumar
- 67
- 3
- 11
2
votes
1 answer
Printing wchar_t to console in C++
I have made a simple program that will read in a PS1 Memory Card binary file and display it's contents in the console using C++ in Visual Studio. The game titles are encoded in the memory in Shift-JIS format, so I used the MultiByteToWideChar…

Jaska
- 187
- 1
- 6
2
votes
1 answer
How to detect and correct the Content-Type charset in email header in python?
What is the correct way to programatically detect and correct the Content-Type charset in an email header in python?
I have a 1000s of emails extracted to .eml (basically plain text) files and some are encoded shift_jis, but the charset in the email…

idij
- 750
- 9
- 19
2
votes
1 answer
PHP convert encoding with Shift_JIS
I have a text file. It contains "砡" character and its encoding is Shift-JIS.
I using function file_get_contents() in PHP (Laravel) to read this file, then response in json for client.
$file = file_get_contents("/path/to/file/text");
$file =…

Quy Nguyen Vu
- 181
- 2
- 13
2
votes
2 answers
SHIFT-JIS to Unicode?
While running a small vba application I want to check if a certain name, e.g. エンジン回転数 occurs in my table by simply matching cell value's to a pre defined string.
How can I store this string エンジン回転数 in VBA? My first guess was to store it in its byte…

Aditya
- 115
- 1
- 10
2
votes
1 answer
Can Shift-JIS contain zeros?
I am having to store sequences of Japanese names written in the Shift-JIS format that are scooped from the internet. I am thinking for storing them in character arrays and writing them to a file with something like:
fprintf(fp,"The name is…

Mick
- 8,284
- 22
- 81
- 173
2
votes
1 answer
ASP MVC Post Encoding Shift-Jis
I have a form that is sits in a plain .html file with the following meta tag:
The service I'm posting a form to requires that the data is in shift-jis encoding. When I post…

Martin Blore
- 2,125
- 4
- 22
- 34
2
votes
2 answers
How does one use shift sequences to output a character from another character set
Reading about how to use shift sequences to print characters from other character sets I've arrived at the following code (of which I'm sure the escape sequence is incorrect, however I do not know why):
#include
int main(int argc, char…

sheeldotme
- 2,237
- 14
- 27
2
votes
1 answer
Convert shift_jis to utf-8
I have a bunch of txt files that is encoded in shift_jis, I want to convert them to utf-8 encoding so the special characters can display properly. This has been probably asked before, but I can't seem to get it right.
Update: I changed my code so it…

tonywang
- 181
- 2
- 13
2
votes
2 answers
Converting UNICODE to shiftJIS
I have a Japanese client and have generated a large flat file (1.2 million rows) of data to send to them.
The file is UTF-8 encoded, which supports storing and displaying all the Japanese characters. The client wishes to receive this file in a…

user2490003
- 10,706
- 17
- 79
- 155
2
votes
0 answers
Why can't it print out the character encoded in Shift-JIS?
#include
#include
#include
int main (void)
{
setlocale(LC_ALL, "ja_JP.Shift_JIS");
char Str[3] = {0x82,0xCC,'\0'};
printf ("(%ls)\n", Str); // --> A
wprintf (L"(%ls) \n", Str); // --> B
…

Kevin Dong
- 5,001
- 9
- 29
- 62