Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Macros | Functions | Variables
codecvt1.cpp File Reference
#include <algorithm>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <locale>
#include <numeric>
#include <cstring>
#include <cwchar>
#include <examples.h>
Include dependency graph for codecvt1.cpp:

Go to the source code of this file.

Macros

#define TMP_BUFFER_SIZE   1024
 

Functions

void do_roundtrip_conversion (const char *locname, const char *buffer)
 
void do_diff_conversion ()
 
int main ()
 

Variables

const char wd_eucjp []
 
const char wd_sjis []
 
const char wd_utf8 []
 
struct { 
 
   const char *   name 
 
   const char *   buffer 
 
} locales [] 
 
std::mbstate_t init = std::mbstate_t ()
 

Macro Definition Documentation

◆ TMP_BUFFER_SIZE

#define TMP_BUFFER_SIZE   1024

codecvt1.cpp - Example program of codecvt facet.

$Id$

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 1994-2006 Rogue Wave Software.

Definition at line 41 of file codecvt1.cpp.

Function Documentation

◆ do_diff_conversion()

void do_diff_conversion ( )

Definition at line 137 of file codecvt1.cpp.

◆ do_roundtrip_conversion()

void do_roundtrip_conversion ( const char *  locname,
const char *  buffer 
)

Definition at line 85 of file codecvt1.cpp.

◆ main()

int main ( void  )

Definition at line 205 of file codecvt1.cpp.

Variable Documentation

◆ buffer

const char* buffer

Definition at line 73 of file codecvt1.cpp.

◆ init

std::mbstate_t init = std::mbstate_t ()

Definition at line 80 of file codecvt1.cpp.

◆ [struct]

const struct { ... } locales[]
Initial value:
= {
{ "ja_JP.UTF-8" , wd_utf8 },
{ "ja_JP.Shift_JIS", wd_sjis },
{ "ja_JP.EUC-JP" , wd_eucjp }
}
const char wd_sjis[]
Definition codecvt1.cpp:53
const char wd_utf8[]
Definition codecvt1.cpp:61
const char wd_eucjp[]
Definition codecvt1.cpp:45

◆ name

const char* name

Definition at line 72 of file codecvt1.cpp.

◆ wd_eucjp

const char wd_eucjp[]
Initial value:
= {
"\xc6\xfc\x0a\xc6\xfc\xcd\xcb\xc6\xfc\x0a\xb7\xee\x0a\xb7\xee\xcd"
"\xcb\xc6\xfc\x0a\xb2\xd0\x0a\xb2\xd0\xcd\xcb\xc6\xfc\x0a\xbf\xe5"
"\x0a\xbf\xe5\xcd\xcb\xc6\xfc\x0a\xcc\xda\x0a\xcc\xda\xcd\xcb\xc6"
"\xfc\x0a\xb6\xe2\x0a\xb6\xe2\xcd\xcb\xc6\xfc\x0a\xc5\xda\x0a\xc5"
"\xda\xcd\xcb\xc6\xfc\x0a"
}

Definition at line 45 of file codecvt1.cpp.

◆ wd_sjis

const char wd_sjis[]
Initial value:
= {
"\x93\xfa\x0a\x93\xfa\x97\x6a\x93\xfa\x0a\x8c\x8e\x0a\x8c\x8e\x97"
"\x6a\x93\xfa\x0a\x89\xce\x0a\x89\xce\x97\x6a\x93\xfa\x0a\x90\x85"
"\x0a\x90\x85\x97\x6a\x93\xfa\x0a\x96\xd8\x0a\x96\xd8\x97\x6a\x93"
"\xfa\x0a\x8b\xe0\x0a\x8b\xe0\x97\x6a\x93\xfa\x0a\x93\x79\x0a\x93"
"\x79\x97\x6a\x93\xfa\x0a"
}

Definition at line 53 of file codecvt1.cpp.

◆ wd_utf8

const char wd_utf8[]
Initial value:
= {
"\xe6\x97\xa5\x0a\xe6\x97\xa5\xe6\x9b\x9c\xe6\x97\xa5\x0a\xe6\x9c"
"\x88\x0a\xe6\x9c\x88\xe6\x9b\x9c\xe6\x97\xa5\x0a\xe7\x81\xab\x0a"
"\xe7\x81\xab\xe6\x9b\x9c\xe6\x97\xa5\x0a\xe6\xb0\xb4\x0a\xe6\xb0"
"\xb4\xe6\x9b\x9c\xe6\x97\xa5\x0a\xe6\x9c\xa8\x0a\xe6\x9c\xa8\xe6"
"\x9b\x9c\xe6\x97\xa5\x0a\xe9\x87\x91\x0a\xe9\x87\x91\xe6\x9b\x9c"
"\xe6\x97\xa5\x0a\xe5\x9c\x9f\x0a\xe5\x9c\x9f\xe6\x9b\x9c\xe6\x97"
"\xa5\x0a"
}

Definition at line 61 of file codecvt1.cpp.