4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Hyunjun Ko <zzoon.ko@samsung.com>, Haejeong Kim <backto.kim@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
25 char *_media_info_generate_uuid(void)
28 static char uuid_unparsed[50];
30 uuid_generate(uuid_value);
31 uuid_unparse(uuid_value, uuid_unparsed);
33 //mediainfo_dbg("UUID : %s", uuid_unparsed);
37 int _media_svc_check_escape_char(char ch)
40 char escape_char[3] = {'%', '_' ,'#'};
42 for (i = 0; i < 3; i++) {
43 if (ch == escape_char[i]) {
51 char *_media_svc_escape_str(char *input, int len)
57 result = (char*)malloc(len * 2 * sizeof(char) + 1);
62 for (i = 0; i < len; i++, j++) {
63 if (input[i] == '\0') break;
65 if (_media_svc_check_escape_char(input[i])) {
67 result[++j] = input[i];