1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <meta http-equiv="Content-Style-Type" content="text/css" /> 6 <link rel="stylesheet" href="../../css/manpage.css" type="text/css" /> 7<title>ConvertStringUtf16NativeToUtf8</title> 8 </head> 9 <body> 10<h1><CODE><a href="../../nn/Overview.html">nn</a>::<a href="../../nn/enc/Overview.html">enc</a>::ConvertStringUtf16NativeToUtf8</CODE> Function</h1> 11<h2>Syntax</h2> 12 <div class="section"> 13 <pre class="definition"> 14<a href="../../nn/Result/Overview.html">Result</a> ConvertStringUtf16NativeToUtf8( 15 <a href="../../nn_types/u8.html">u8</a> * pDst, 16 <a href="../../nn_types/s32.html">s32</a> * pDstSize, 17 const <a href="../../nn_types/u16.html">u16</a> * pSrc, 18 <a href="../../nn_types/s32.html">s32</a> * pSrcSize 19); 20</pre> 21 </div> 22<h2>Parameters</h2> 23 <div class="section"> 24 <table class="arguments"> 25 <thead> 26 <tr> 27 <td width="15" /> 28<th>Name</th> 29<td>Description</td> 30 </tr> 31 </thead> 32 <tr> 33<td>out</td> 34<th><CODE>pDst</CODE></th> 35<td>The buffer into which the converted string is written. No terminating character is added. A string is not written when <SPAN class="argument">pDst</SPAN> is <CODE>NULL</CODE>.</td> 36 </tr> 37 <tr> 38 <td /> 39<th><CODE>pDstSize</CODE></th> 40<td>The size of the buffer into which the converted string is written. This is the size of the converted string in <CODE>*</CODE><SPAN class="argument">pDst</SPAN> (the size of the buffer divided by the size of the type). After data is converted, this stores a value that indicates how much was written to the buffer. When <SPAN class="argument">pDst</SPAN> is <CODE>NULL</CODE>, the size of the output buffer is ignored and this instead stores the buffer size necessary for writing the converted string.</td> 41 </tr> 42 <tr> 43<td>out</td> 44<th><CODE>pSrc</CODE></th> 45<td>The source string buffer.</td> 46 </tr> 47 <tr> 48 <td /> 49<th><CODE>pSrcSize</CODE></th> 50<td>Size of the source string buffer. This is the size of the string to convert in <CODE>*</CODE><SPAN class="argument">pSrc</SPAN> (the size of the buffer divided by the size of the type). Data is not read beyond the size specified by <SPAN class="argument">pSrcSize</SPAN>. If <SPAN class="argument">pSrcSize</SPAN> is <CODE>NULL</CODE> or negative, data is read from <SPAN class="argument">pSrc</SPAN> until a terminating character is found. If <SPAN class="argument">pSrcSize</SPAN> is not <CODE>NULL</CODE>, this stores the size of the string buffer that is read.</td> 51 </tr> </table> 52 </div> 53<h2>Return Values</h2> 54<div class="section">Returns the result. <br /> 55 <table class="arguments"> 56 <thead> 57 <tr> 58<th>Value</th> 59<td>Description</td> 60 </tr> 61 </thead> 62 <tr> 63<th><CODE>ResultNoBufferLeft</CODE></th> 64<td>Insufficient buffer size.</td> 65 </tr> 66 <tr> 67<th><CODE>ResultInvalidParameter</CODE></th> 68<td>An invalid argument was passed.</td> 69 </tr> 70 <tr> 71<th><CODE>ResultInvalidFormat</CODE></th> 72<td>An unconvertible character was detected.</td> 73 </tr> 74 </table> </div> 75<h2>Description</h2> 76 <div class="section"> 77<p>Converts the character code of the provided string from <CODE>UTF-16LE</CODE> to <CODE>UTF-8</CODE> in little-endian environments and from <CODE>UTF-16BE</CODE> to <CODE>UTF-8</CODE> in big-endian environments, and then gets the buffer size required to write the converted string. No terminating character is added. If a destination buffer is not specified, the buffer size necessary for the write operation will be obtained.</p><!-- write here --></div> 78<h2>Revision History</h2> 79 <div class="section"> 80 <dl class="history"> 81 <dt>2011/10/27</dt> 82<dd>Initial version.<br /> 83 </dd> 84 </dl> 85 </div> 86 <hr><p>CONFIDENTIAL</p></body> 87</html>