質問編集履歴
1
2020/10/16テスト記録更新
test
CHANGED
File without changes
|
test
CHANGED
@@ -322,4 +322,230 @@
|
|
322
322
|
|
323
323
|
|
324
324
|
|
325
|
+
|
326
|
+
|
327
|
+
#追記
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
###テスト実行記録2020/10/16
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
```html
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
#post_test.html
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
<html>
|
346
|
+
|
347
|
+
<head>
|
348
|
+
|
349
|
+
<meta http-equiv="Content-Type" content="text/html"; charset="euc-jp">
|
350
|
+
|
351
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
352
|
+
|
353
|
+
<title>Document</title>
|
354
|
+
|
355
|
+
</head>
|
356
|
+
|
357
|
+
<body>
|
358
|
+
|
359
|
+
<h1>顔文字をujisのデータベースに文字化けなく入れたい。</h1>
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
<form action="https://localhost/new_sen-aso.com\tpl_site_adm\post_test.cgi" name="form01" method="post" enctype="multipart/form-data" autocomplete="off">
|
364
|
+
|
365
|
+
|
366
|
+
|
325
|
-
|
367
|
+
<fieldset>
|
368
|
+
|
369
|
+
<input name="mode" type="hidden" value="foofoo" />
|
370
|
+
|
371
|
+
<div class="woo"><textarea name="foo" id="foo" cols="92" rows="5" class="form-control" placeholder="ここに入力※htmlタグ不可"></textarea></div>
|
372
|
+
|
373
|
+
|
374
|
+
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
<input type="submit" value="プロフィールを新規登録する" style="margin:15px 0;" class="btn btn-block btn-success btn-lg">
|
380
|
+
|
381
|
+
</fieldset>
|
382
|
+
|
383
|
+
</form>
|
384
|
+
|
385
|
+
</body>
|
386
|
+
|
387
|
+
</html>
|
388
|
+
|
389
|
+
```
|
390
|
+
|
391
|
+
|
392
|
+
|
393
|
+
|
394
|
+
|
395
|
+
|
396
|
+
|
397
|
+
```Perl
|
398
|
+
|
399
|
+
#!/usr/bin/perl
|
400
|
+
|
401
|
+
print "Content-type: text/html\n\n";
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
#post_test.cgi
|
406
|
+
|
407
|
+
|
408
|
+
|
409
|
+
use DBI;
|
410
|
+
|
411
|
+
use Encode;
|
412
|
+
|
413
|
+
|
414
|
+
|
415
|
+
require '../stdio.pl';
|
416
|
+
|
417
|
+
|
418
|
+
|
419
|
+
$dbName = 'test_db';
|
420
|
+
|
421
|
+
$dbPass = 'root';
|
422
|
+
|
423
|
+
$dbUser = 'root';
|
424
|
+
|
425
|
+
|
426
|
+
|
427
|
+
|
428
|
+
|
429
|
+
$dsn = "DBI:mysql:$dbName";
|
430
|
+
|
431
|
+
$dbh = DBI->connect( $dsn, $dbUser, $dbPass, { RaiseError => 1 } );
|
432
|
+
|
433
|
+
$dbh->do("set names ujis");
|
434
|
+
|
435
|
+
|
436
|
+
|
437
|
+
|
438
|
+
|
439
|
+
%param = ();
|
440
|
+
|
441
|
+
$key_type=''; $key_type_num=0;
|
442
|
+
|
443
|
+
$girl_option=''; $girl_option_num=0;
|
444
|
+
|
445
|
+
@keys = stdio::getFormData(\%param, "", "EUC", ";", "$img_dir/");
|
446
|
+
|
447
|
+
foreach(@keys){
|
448
|
+
|
449
|
+
if(/file/){ next; }
|
450
|
+
|
451
|
+
if (/^key_type/) {
|
452
|
+
|
453
|
+
$param{'key_type'} .= $param{$_}." ";
|
454
|
+
|
455
|
+
$key_type_num++;
|
456
|
+
|
457
|
+
next;
|
458
|
+
|
459
|
+
}
|
460
|
+
|
461
|
+
if (/^girl_option/) {
|
462
|
+
|
463
|
+
$param{'girl_option'} .= $param{$_}." ";
|
464
|
+
|
465
|
+
$girl_option_num++;
|
466
|
+
|
467
|
+
next;
|
468
|
+
|
469
|
+
}
|
470
|
+
|
471
|
+
$param{$_} =~ s/\'/’/g;
|
472
|
+
|
473
|
+
$param{$_} =~ s/\"/”/g;
|
474
|
+
|
475
|
+
}
|
476
|
+
|
477
|
+
|
478
|
+
|
479
|
+
if($param{'mode'} eq 'foofoo'){
|
480
|
+
|
481
|
+
|
482
|
+
|
483
|
+
|
484
|
+
|
485
|
+
|
486
|
+
|
487
|
+
if($param{'foo'}){
|
488
|
+
|
489
|
+
print $param{'foo'};
|
490
|
+
|
491
|
+
$query = qq|
|
492
|
+
|
493
|
+
INSERT INTO `test_hoge`(`comment`) VALUES ("$param{'foo'}")
|
494
|
+
|
495
|
+
|;
|
496
|
+
|
497
|
+
$sth = $dbh->prepare($query);
|
498
|
+
|
499
|
+
}else{
|
500
|
+
|
501
|
+
print"foooooooooooooooooooooooooooooooooooo";
|
502
|
+
|
503
|
+
}
|
504
|
+
|
505
|
+
|
506
|
+
|
507
|
+
|
508
|
+
|
509
|
+
}
|
510
|
+
|
511
|
+
|
512
|
+
|
513
|
+
$sth->finish();
|
514
|
+
|
515
|
+
$dbh->disconnect;
|
516
|
+
|
517
|
+
|
518
|
+
|
519
|
+
|
520
|
+
|
521
|
+
```
|
522
|
+
|
523
|
+
|
524
|
+
|
525
|
+
|
526
|
+
|
527
|
+
筆者は上記のようにXAMPP環境で実運用の処理をを限りなく忠実に再現して、
|
528
|
+
|
529
|
+
ブラウザに表示、DB上に表示させるテストに成功しましたが
|
530
|
+
|
531
|
+
問題のこの子たち↓は文字化けはしませんでした。これには思わず笑いました(笑)
|
532
|
+
|
533
|
+
(∩´﹏`∩) (。◕∀◕。)ノ⋆。оO(㋵㋺㋛㋗㋧♡
|
534
|
+
|
535
|
+
( ˘͈ ᵕ ˘͈ )♡
|
536
|
+
|
537
|
+
( *ˊᵕˋ)✩︎‧₊♡
|
538
|
+
|
539
|
+
( ⸝⸝•ᴗ•⸝⸝ )੭⁾⁾
|
540
|
+
|
541
|
+
|
542
|
+
|
543
|
+
|
544
|
+
|
545
|
+
|
546
|
+
|
547
|
+
|
548
|
+
|
549
|
+
クライアントが使用するデバイス・ブラウザ・顔文字キーボードアプリ(Simeji)などいろいろパターンを調査のち検証を重ねて特定を試みます。
|
550
|
+
|
551
|
+
先輩の皆様、ありがとうございました。
|