Skip to content

Instantly share code, notes, and snippets.

View brokendish's full-sized avatar

brokendish brokendish

View GitHub Profile
@brokendish
brokendish / iconv_Chk_KAI.c
Created September 8, 2013 14:33
文字コード変換を行う一括で文字コード変換を行い、変換不可文字があった場合は「@」に置き換える。このモジュールは、1文字ずつの変換ではなく全文を変換に通し、変換エラーがあった場合はエラーポインターの位置に「@」を入れ込む
#include <stdio.h>
#include <iconv.h>
#include <locale.h>
#include <stdlib.h>
#include <string.h>
#include <wchar.h>
/* fgetsの指定バイト数 */
#define READ_SIZE 4096
/* 置き換え文字のサイズ */
@brokendish
brokendish / iconv_Chk.c.txt
Created September 1, 2013 13:56
iconv_Chk.c結果イメージ
----------------replace_code--------------------S
変換前>---len--:47 [日本語表示aああbいcうdえ丨❚お@
]
***************************
-----変換文字コード------
befMoji: e38182 aftMoji:e38186
befMoji: x61 aftMoji: x65
---日---leng=3 CODE �==ffffffe6 CODE �==ffffff97 CODE �==ffffffa5
---本---leng=3 CODE �==ffffffe6 CODE �==ffffff9c CODE �==ffffffac
@brokendish
brokendish / iconv_Chk.c
Last active December 22, 2015 02:38
文字コード変換を行う 1文字ずつ文字コード変換を行う。変換不可文字があった場合は「?」に置き換える
#include <stdio.h>
#include <iconv.h>
#include <locale.h>
#include <stdlib.h>
#include <string.h>
#include <wchar.h>
/* fgetsの指定バイト数 */
#define READ_SIZE 4096
/* 置き換え文字のサイズ */
備忘録
Visual Basic 6.0 を使用して、Visual Basic と C 関数の間または Visual Basic と C++ 関数の間で配列や文字列を受け渡す方法
http://support.microsoft.com/kb/205277/ja
Visual C++で純粋なC言語としてコンパイルする方法
http://tinqwill.blog59.fc2.com/blog-entry-68.html
@brokendish
brokendish / tokusyu-A.xml
Created August 25, 2013 13:51
tokusyu-A.xml
<?xml version="1.0" encoding="UTF-8"?><Report xmlns="http://xml.kishou.go.jp/jmaxml1/" xmlns:jmx="http://xml.kishou.go.jp/jmaxml1/"> <Control> <Title>特殊気象報</Title> <DateTime>2008-07-31T01:15:20Z</DateTime> <Status>通常</Status> <EditorialOffice>横浜地方気象台</EditorialOffice> <PublishingOffice>横浜地方気象台</PublishingOffice> </Control> <Head xmlns="http://xml.kishou.go.jp/jmaxml1/informationBasis1/"> <Title>特殊気象報(各種現象)</Title> <ReportDateTime>2008-07-31T10:00:00+09:00</ReportDateTime> <TargetDateTime>2008-07-31T09:40:00+09:00</TargetDateTime> <EventID>20080731100000_黄砂</EventID> <InfoType>訂正</InfoType> <Serial /> <InfoKind>特殊気象報</InfoKind> <InfoKindVersion>1.0_0</InfoKindVersion> <Headline> <Text /> </Headline> </Head> <Body xmlns="http://xml.kishou.go.jp/jmaxml1/body/meteorology1/"> <MeteorologicalInfos type="特殊気象報(各種現象)"> <MeteorologicalInfo> <DateTime significant="yyyy-mm-ddThh:mm">2008-07-31T09:40:00+09:00</DateTime> <Item> <Kind>
@brokendish
brokendish / tokusyu-3.xml
Created August 25, 2013 13:50
tokusyu-3.xml
<?xml version="1.0" encoding="UTF-8"?>
<Report xmlns="http://xml.kishou.go.jp/jmaxml1/" xmlns:jmx="http://xml.kishou.go.jp/jmaxml1/">
<Control>
<Title>特殊気象報</Title>
<DateTime>2008-07-31T01:15:20Z</DateTime>
<Status>通常</Status>
<EditorialOffice>横浜地方気象台</EditorialOffice>
<PublishingOffice>横浜地方気象台</PublishingOffice>
</Control>
<Head xmlns="http://xml.kishou.go.jp/jmaxml1/informationBasis1/">
@brokendish
brokendish / xml_CSV.conf
Created August 25, 2013 13:49
xml_CSV.conf
<namespase>
x,http://xml.kishou.go.jp/jmaxml1/
xh,http://xml.kishou.go.jp/jmaxml1/informationBasis1/
xb,http://xml.kishou.go.jp/jmaxml1/body/meteorology1/
</namespase>
<xpath>
/x:Report/x:Control/x:Status
/x:Report/xh:Head/xh:TargetDateTime
/x:Report/xb:Body/xb:MeteorologicalInfos/xb:MeteorologicalInfo/xb:Item/xb:Station/xb:Name
@brokendish
brokendish / xml_CSV_Getlib.h
Created August 25, 2013 13:49
xml_CSV_Getlib.h
/* xml_CSV_Get.h */
#ifndef XML_CSV_GETLIB_H
#define XML_CSV_GETLIB_H
#include <libxml/tree.h>
#include <libxml/parser.h>
#include <libxml/xpath.h>
/* fgetsの指定バイト数 */
#define READ_SIZE 4096
@brokendish
brokendish / xml_CSV_Getlib.c
Created August 25, 2013 13:48
xml_CSV_Getlib.c
#include <stdio.h>
#include <string.h>
#include <libxml/tree.h>
#include <libxml/parser.h>
#include <libxml/xpath.h>
#include <regex.h>
#include "xml_CSV_Getlib.h"
/* デバグ用定義 */
/*#define DEBUG1*/
@brokendish
brokendish / xml_CSV_Get.c
Created August 25, 2013 13:47
xml_CSV_Get.c 作成中ーまだ動かない
#include <stdio.h>
#include <string.h>
#include "xml_CSV_Getlib.h"
/* デバグ用定義 */
/*#define DEBUG1*/
/*
----------------------------------------------------------------------
気象庁のMXLファイルから必要な部分を抽出してCSVファイルにする
「xml_CSV_Getlib.c」の「xmlCSV_Get_Main」実行用のドライバ