ホーム » Linux » DS115j Web での日本語

2017年6月
 123
45678910
11121314151617
18192021222324
252627282930  

カテゴリー

アーカイブ

ブログ統計情報

  • 80,010 アクセス



DS115j Web での日本語

DS115j の標準出力をブラウザで表示すると,日本語部分が表示できない.


コードはこんな感じ.

  #include	"i_DrawLg.hxx"
  #include	<iostream>
  int	_tmain	(int argc,TCHAR* argv[])
  {
	_tsetlocale(LC_ALL,_T("")) ;
	tstring	orgCode1 = _T("ostrstream-%E3%81%AE%E5%88%A9%E7%94%A8%E3%81%A7%E3%83%A1%E3%83%A2%E3%83%AA%E3%83%AA%E3%83%BC%E3%82%AF/") ;
	tstring	orgCode2 = _T("url=http%3A%2F%2Fiwao.synology.me%2Fwordpress%2Fdev%2F2011%2F12%2F01%2Fvirtual-pc-%25E3%2581%258C%25E9%2581%2585%25E3%2581%2584%2F&usg=AFQ") ;
	tstring	deco_1_1 = ::PL_Decode_url(orgCode1) ;
	tstring	deco_2_1 = ::PL_Decode_url(orgCode2) ;
	tstring	deco_1_2 = ::PL_Decode_url(deco_1_1) ;
	tstring	deco_2_2 = ::PL_Decode_url(deco_2_1) ;
	std::tout <<    tstring(orgCode1.c_str()) << std::endl ;
	std::tout <<  ::UTF8_To(deco_1_1.c_str()) << std::endl ;
	std::tout <<  ::UTF8_To(deco_1_2.c_str()) << std::endl ;
	std::tout <<    tstring(orgCode2.c_str()) << std::endl ;
	std::tout <<  ::UTF8_To(deco_2_1.c_str()) << std::endl ;
	std::tout <<  ::UTF8_To(deco_2_2.c_str()) << std::endl ;
	return	0 ;
	}

コンソールでの出力 Iwao@DS115j:~/www/T_php/temp/test/DecodeU$ Iwao@DS115j:~/www/T_php/temp/test/DecodeU$ php index.php <pre> ostrstream-%E3%81%AE%E5%88%A9%E7%94%A8%E3%81%A7%E3%83%A1%E3%83%A2%E3%83%AA%E3%83%AA%E3%83%BC%E3%82%AF/ ostrstream-の利用でメモリリーク/ ostrstream-の利用でメモリリーク/ url=http%3A%2F%2Fiwao.synology.me%2Fwordpress%2Fdev%2F2011%2F12%2F01%2Fvirtual-pc-%25E3%2581%258C%25E9%2581%2585%25E3%2581%2584%2F&usg=AFQ url=http://iwao.synology.me/wordpress/dev/2011/12/01/virtual-pc-%E3%81%8C%E9%81%85%E3%81%84/&usg=AFQ url=http://iwao.synology.me/wordpress/dev/2011/12/01/virtual-pc-が遅い/&usg=AFQ </pre> Iwao@DS115j:~/www/T_php/temp/test/DecodeU$
ブラウザでの出力 ostrstream-%E3%81%AE%E5%88%A9%E7%94%A8%E3%81%A7%E3%83%A1%E3%83%A2%E3%83%AA%E3%83%AA%E3%83%BC%E3%82%AF/ ostrstream- ostrstream- url=http%3A%2F%2Fiwao.synology.me%2Fwordpress%2Fdev%2F2011%2F12%2F01%2Fvirtual-pc-%25E3%2581%258C%25E9%2581%2585%25E3%2581%2584%2F&usg=AFQ url=http://iwao.synology.me/wordpress/dev/2011/12/01/virtual-pc-%E3%81%8C%E9%81%85%E3%81%84/&usg=AFQ url=http://iwao.synology.me/wordpress/dev/2011/12/01/virtual-pc-

どこかの設定の問題とは思うが,場所がわからない.
それとも,変換がかかる部分を NOP とすべきか?


2017/06/02
Linux の場合 UTF8 となっていると思うので,::UTF8_To をしなくても良いはず.
Windows の場合は,tstring への変換(UTF8 から S-JIS または UTF16)が必要.
UTF8_To を _MSC_VER で振り分ける様に修正.


と思ってやって,上のコードではクリアしたが,
他にもうまくないコードがある様で,drawlog.htm が途中で切れている.
(/tmp/…/i_Tools.tmp/…/dump.txt は意図したデータで出力されている)


html 出力 (HtmOut::Export) の ::SaveUTF8 から呼んでいる ::To_UTF8 も同様に修正.
Windows の場合は,tstring (S-JIS または UTF16)から UTF8 の変換が必要.

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

コメントする

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

%d人のブロガーが「いいね」をつけました。