
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Using the APIs
|
175
needs to first convert paths from the locale-specific encoding to UTF-8 before pass-
ing those paths to the Subversion libraries, and then reconvert any resultant output
paths from Subversion back into the locale’s encoding before using those paths for
non-Subversion purposes. Fortunately, Subversion provides a suite of functions (see
subversion/include/svn_utf.h) that can be used by any program to do these conver-
sions.
Also, Subversion APIs require all URL parameters to be properly URI-encoded. So,
instead of passing file:///home/username/My File.txt as the URL of a file named
My
File.txt
, you need to pass file:///home/username/My%20File.txt. Again, Subversion
supplies helper functions that your application can use—svn_path_uri_encode and
svn_path_uri_decode, for URI encoding and decoding, respectively.
Using Languages Other than C and C++
If you are interested in using the Subversion libraries in conjunction with something
other than a C program—such as a Python script or Java application—Subversion
has some initial support for this via the Simplified Wrapper and Interface Generator
(SWIG). The SWIG bindings for Subversion are located in subversion/bindings/swig
and are slowly maturing into a usable state. These bindings allow you to call Subver-
sion API functions ...